Hi Wolfgang,
On Tue, Oct 16, 2012 at 9:43 PM, Wolfgang Denk wrote:
> Dear Marek Vasut,
>
> In message <201210160831.20759.ma...@denx.de> you wrote:
>>
>> > In short, returning non-NULL from malloc(0) and expecting a CPU exception
>> > when it is de-referenced is not going to fly.
>
> We should no
Marek Vasut wrote on 2012/10/16 12:43:08:
>
> Dear Joakim Tjernlund,
>
> [...]
>
> > > do about this patch?
> >
> > Skip the idea to protect a page, this is too complicated for a boot
> > loader. Just
> > treat malloc(0) as malloc(1) internally.
>
> I was more interested in knowing if we shou
Dear Marek Vasut,
In message <201210160831.20759.ma...@denx.de> you wrote:
>
> > In short, returning non-NULL from malloc(0) and expecting a CPU exception
> > when it is de-referenced is not going to fly.
We should not expect to have support for any exceptions for any kind
of illegal accesses.
Dear Joakim Tjernlund,
[...]
> > do about this patch?
>
> Skip the idea to protect a page, this is too complicated for a boot
> loader. Just
> treat malloc(0) as malloc(1) internally.
I was more interested in knowing if we should drop the patch or what ... ?
Best regards,
Marek Vasut
_
Marek Vasut wrote on 2012/10/16 08:31:20:
>
> Dear Graeme Russ,
>
> > On 04/03/2012 09:35 AM, Graeme Russ wrote:
> > > Hi Jocke
> > >
> > > And I really need to check, but I have a sneaking suspicion that as
the
> > > code currently stands in U-Boot/x86 dereferencing a NULL pointer
won't
> >
Dear Graeme Russ,
> On 04/03/2012 09:35 AM, Graeme Russ wrote:
> > Hi Jocke
> >
> > And I really need to check, but I have a sneaking suspicion that as the
> > code currently stands in U-Boot/x86 dereferencing a NULL pointer won't
> > cause an exception. In x86, U-Boot configures all protected mo
On 04/03/2012 09:35 AM, Graeme Russ wrote:
> Hi Jocke
> And I really need to check, but I have a sneaking suspicion that as the
> code currently stands in U-Boot/x86 dereferencing a NULL pointer won't
> cause an exception. In x86, U-Boot configures all protected mode segments
> to be 4GB starting
Hi Jocke
On Tue, Apr 3, 2012 at 7:14 AM, Joakim Tjernlund
wrote:
> Graeme Russ wrote on 2012/04/02 22:59:57:
>>
>>
>> On Apr 3, 2012 6:57 AM, "Joakim Tjernlund"
>> wrote:
>> >
>> > Graeme Russ wrote on 2012/04/02 22:28:46:
>> > > From: Graeme Russ
>> > >
>> > > On 04/02/2012 05:40 PM, Joakim
Graeme Russ wrote on 2012/04/02 22:59:57:
>
>
> On Apr 3, 2012 6:57 AM, "Joakim Tjernlund"
> wrote:
> >
> > Graeme Russ wrote on 2012/04/02 22:28:46:
> > > From: Graeme Russ
> > >
> > > On 04/02/2012 05:40 PM, Joakim Tjernlund wrote:
> > > > Hi Grame
> > > >
> > > > Graeme Russ wrote on 2012/
vapierfil...@gmail.com wrote on 2012/04/02 21:14:14:
>
> On Mon, Apr 2, 2012 at 14:40, Joakim Tjernlund wrote:
> > Marek Vasut wrote on 2012/04/02 20:00:03:
> >> Dear Joakim Tjernlund,
> >> > Depends, if writing generic code for lots of OS:es you cannot rely
> >> > malloc(0). Writing kernel code y
On Apr 3, 2012 6:57 AM, "Joakim Tjernlund"
wrote:
>
> Graeme Russ wrote on 2012/04/02 22:28:46:
> > From: Graeme Russ
> >
> > On 04/02/2012 05:40 PM, Joakim Tjernlund wrote:
> > > Hi Grame
> > >
> > > Graeme Russ wrote on 2012/04/02 09:17:44:
> > >>
> > >> Hi Joakim,
> > >> On Apr 2, 2012 4:55
Graeme Russ wrote on 2012/04/02 22:28:46:
> From: Graeme Russ
>
> On 04/02/2012 05:40 PM, Joakim Tjernlund wrote:
> > Hi Grame
> >
> > Graeme Russ wrote on 2012/04/02 09:17:44:
> >>
> >> Hi Joakim,
> >> On Apr 2, 2012 4:55 PM, "Joakim Tjernlund"
> >> wrote:
> >>>
>
> Hi Marek,
>
On 04/02/2012 05:40 PM, Joakim Tjernlund wrote:
> Hi Grame
>
> Graeme Russ wrote on 2012/04/02 09:17:44:
>>
>> Hi Joakim,
>> On Apr 2, 2012 4:55 PM, "Joakim Tjernlund"
>> wrote:
>>>
Hi Marek,
On Mon, Apr 2, 2012 at 1:36 PM, Marek Vasut wrote:
> Dear Mike Frysinger,
Dear Joakim Tjernlund,
> Marek Vasut wrote on 2012/04/02 20:00:03:
> > Dear Joakim Tjernlund,
> >
> > > Marek Vasut wrote on 2012/04/02 18:39:33:
> > > > From: Marek Vasut
> > > >
> > > > Dear Joakim Tjernlund,
> > > >
> > > > > Marek Vasut wrote on 2012/04/02 17:23:03:
> > > > > > Dear Joa
On Mon, Apr 2, 2012 at 14:40, Joakim Tjernlund wrote:
> Marek Vasut wrote on 2012/04/02 20:00:03:
>> Dear Joakim Tjernlund,
>> > Depends, if writing generic code for lots of OS:es you cannot rely
>> > malloc(0). Writing kernel code you can.
>>
>> No you cannot. It's in the spec you cannot and you
Marek Vasut wrote on 2012/04/02 20:00:03:
>
> Dear Joakim Tjernlund,
>
> > Marek Vasut wrote on 2012/04/02 18:39:33:
> > > From: Marek Vasut
> > >
> > > Dear Joakim Tjernlund,
> > >
> > > > Marek Vasut wrote on 2012/04/02 17:23:03:
> > > > > Dear Joakim Tjernlund,
> > > > >
> > > > > > Marek Va
Dear Joakim Tjernlund,
> Marek Vasut wrote on 2012/04/02 18:39:33:
> > From: Marek Vasut
> >
> > Dear Joakim Tjernlund,
> >
> > > Marek Vasut wrote on 2012/04/02 17:23:03:
> > > > Dear Joakim Tjernlund,
> > > >
> > > > > Marek Vasut wrote on 2012/04/02 16:42:30:
> > > > > > Dear Joakim Tjer
Marek Vasut wrote on 2012/04/02 18:39:33:
> From: Marek Vasut
>
> Dear Joakim Tjernlund,
>
> > Marek Vasut wrote on 2012/04/02 17:23:03:
> > > Dear Joakim Tjernlund,
> > >
> > > > Marek Vasut wrote on 2012/04/02 16:42:30:
> > > > > Dear Joakim Tjernlund,
> > > > >
> > > > > > Marek Vasut wrot
Dear Joakim Tjernlund,
> Marek Vasut wrote on 2012/04/02 17:23:03:
> > Dear Joakim Tjernlund,
> >
> > > Marek Vasut wrote on 2012/04/02 16:42:30:
> > > > Dear Joakim Tjernlund,
> > > >
> > > > > Marek Vasut wrote on 2012/04/02 16:05:13:
> > > > > > Dear Joakim Tjernlund,
> > > > > >
> > > >
Marek Vasut wrote on 2012/04/02 17:23:03:
>
> Dear Joakim Tjernlund,
>
> > Marek Vasut wrote on 2012/04/02 16:42:30:
> > > Dear Joakim Tjernlund,
> > >
> > > > Marek Vasut wrote on 2012/04/02 16:05:13:
> > > > > Dear Joakim Tjernlund,
> > > > >
> > > > > > Hi Grame
> > > > > >
> > > > > > Graeme
Dear Joakim Tjernlund,
> Marek Vasut wrote on 2012/04/02 16:42:30:
> > Dear Joakim Tjernlund,
> >
> > > Marek Vasut wrote on 2012/04/02 16:05:13:
> > > > Dear Joakim Tjernlund,
> > > >
> > > > > Hi Grame
> > > > >
> > > > > Graeme Russ wrote on 2012/04/02 09:17:44:
> > > > > > Hi Joakim,
> >
Marek Vasut wrote on 2012/04/02 16:42:30:
>
> Dear Joakim Tjernlund,
>
> > Marek Vasut wrote on 2012/04/02 16:05:13:
> > > Dear Joakim Tjernlund,
> > >
> > > > Hi Grame
> > > >
> > > > Graeme Russ wrote on 2012/04/02 09:17:44:
> > > > > Hi Joakim,
> > > > >
> > > > > On Apr 2, 2012 4:55 PM, "Joa
Dear Joakim Tjernlund,
> Marek Vasut wrote on 2012/04/02 16:05:13:
> > Dear Joakim Tjernlund,
> >
> > > Hi Grame
> > >
> > > Graeme Russ wrote on 2012/04/02 09:17:44:
> > > > Hi Joakim,
> > > >
> > > > On Apr 2, 2012 4:55 PM, "Joakim Tjernlund"
> > > >
> >
> > wrote:
> > > > > > Hi Marek,
>
Marek Vasut wrote on 2012/04/02 16:05:13:
>
> Dear Joakim Tjernlund,
>
> > Hi Grame
> >
> > Graeme Russ wrote on 2012/04/02 09:17:44:
> > > Hi Joakim,
> > >
> > > On Apr 2, 2012 4:55 PM, "Joakim Tjernlund"
> wrote:
> > > > > Hi Marek,
> > > > >
> > > > > On Mon, Apr 2, 2012 at 1:36 PM, Marek Vas
Dear Joakim Tjernlund,
> Hi Grame
>
> Graeme Russ wrote on 2012/04/02 09:17:44:
> > Hi Joakim,
> >
> > On Apr 2, 2012 4:55 PM, "Joakim Tjernlund"
wrote:
> > > > Hi Marek,
> > > >
> > > > On Mon, Apr 2, 2012 at 1:36 PM, Marek Vasut
wrote:
> > > > > Dear Mike Frysinger,
> > > > >
> > > > >>
Hi Grame
Graeme Russ wrote on 2012/04/02 09:17:44:
>
> Hi Joakim,
> On Apr 2, 2012 4:55 PM, "Joakim Tjernlund"
> wrote:
> >
> > >
> > > Hi Marek,
> > >
> > > On Mon, Apr 2, 2012 at 1:36 PM, Marek Vasut wrote:
> > > > Dear Mike Frysinger,
> > > >
> > > >> On Sunday 01 April 2012 20:25:44 Graeme
Hi Joakim,
On Apr 2, 2012 4:55 PM, "Joakim Tjernlund"
wrote:
>
> >
> > Hi Marek,
> >
> > On Mon, Apr 2, 2012 at 1:36 PM, Marek Vasut
wrote:
> > > Dear Mike Frysinger,
> > >
> > >> On Sunday 01 April 2012 20:25:44 Graeme Russ wrote:
> > >> > b) The code calling malloc(0) is making a perfectly leg
>
> Hi Marek,
>
> On Mon, Apr 2, 2012 at 1:36 PM, Marek Vasut wrote:
> > Dear Mike Frysinger,
> >
> >> On Sunday 01 April 2012 20:25:44 Graeme Russ wrote:
> >> > b) The code calling malloc(0) is making a perfectly legitimate assumption
> >> >
> >> > based on how glibc handles malloc(0)
> >>
> >
Graeme Russ wrote on 2012/04/02 05:05:51:
>
> Hi Marek,
>
> On Mon, Apr 2, 2012 at 12:51 PM, Marek Vasut wrote:
> > Dear Graeme Russ,
> >
> >> Hi Marek,
>
> >> Bottom line is, we could do either and we would be 100% compliant with the
> >> C standard
> >>
> >> The question is, what would be more
Hi Marek,
On Mon, Apr 2, 2012 at 2:23 PM, Marek Vasut wrote:
> Dear Graeme Russ,
>
>> Hi Marek,
>>
>> On Mon, Apr 2, 2012 at 1:36 PM, Marek Vasut wrote:
>> > Dear Mike Frysinger,
>> >
>> >> On Sunday 01 April 2012 20:25:44 Graeme Russ wrote:
>> >> > b) The code calling malloc(0) is making a perf
Dear Graeme Russ,
> Hi Marek,
>
> On Mon, Apr 2, 2012 at 1:36 PM, Marek Vasut wrote:
> > Dear Mike Frysinger,
> >
> >> On Sunday 01 April 2012 20:25:44 Graeme Russ wrote:
> >> > b) The code calling malloc(0) is making a perfectly legitimate
> >> > assumption
> >> >
> >> >based on how glibc
Hi Marek,
On Mon, Apr 2, 2012 at 1:36 PM, Marek Vasut wrote:
> Dear Mike Frysinger,
>
>> On Sunday 01 April 2012 20:25:44 Graeme Russ wrote:
>> > b) The code calling malloc(0) is making a perfectly legitimate assumption
>> >
>> > based on how glibc handles malloc(0)
>>
>> not really. POSIX sa
Dear Mike Frysinger,
> On Sunday 01 April 2012 18:40:05 Graeme Russ wrote:
> > if ((long)bytes == 0) {
> >
> > DEBUG("Warning: malloc of zero block size\n");
> > bytes = 1;
> >
> > } else if ((long)bytes < 0) {
> >
> >
Dear Mike Frysinger,
> On Sunday 01 April 2012 20:25:44 Graeme Russ wrote:
> > b) The code calling malloc(0) is making a perfectly legitimate assumption
> >
> >based on how glibc handles malloc(0)
>
> not really. POSIX says malloc(0) is implementation defined (so it may
> return a unique ad
Hi Mike,
On Mon, Apr 2, 2012 at 1:12 PM, Mike Frysinger wrote:
> On Sunday 01 April 2012 20:25:44 Graeme Russ wrote:
>> b) The code calling malloc(0) is making a perfectly legitimate assumption
>> based on how glibc handles malloc(0)
>
> not really. POSIX says malloc(0) is implementation defi
On Sunday 01 April 2012 20:25:44 Graeme Russ wrote:
> b) The code calling malloc(0) is making a perfectly legitimate assumption
>based on how glibc handles malloc(0)
not really. POSIX says malloc(0) is implementation defined (so it may return a
unique address, or it may return NULL). no use
On Sunday 01 April 2012 18:40:05 Graeme Russ wrote:
> if ((long)bytes == 0) {
> DEBUG("Warning: malloc of zero block size\n");
> bytes = 1;
> } else if ((long)bytes < 0) {
> DEBUG("Error: malloc of negative block size\n");
>
Hi Marek,
On Mon, Apr 2, 2012 at 12:51 PM, Marek Vasut wrote:
> Dear Graeme Russ,
>
>> Hi Marek,
>> Bottom line is, we could do either and we would be 100% compliant with the
>> C standard
>>
>> The question is, what would be more onerous. Since the majority of U-Boot
>> developers will be more
Dear Graeme Russ,
> Hi Marek,
>
> On Mon, Apr 2, 2012 at 11:04 AM, Marek Vasut wrote:
> > Dear Graeme Russ,
> >
> >> Hi Marek,
> >>
> >> On Mon, Apr 2, 2012 at 10:13 AM, Marek Vasut wrote:
> >> > Dear Graeme Russ,
> >> >
> >> >> Hi Marek,
> >> >>
> >> >> On Mon, Apr 2, 2012 at 9:45 AM, Mare
Hi Marek,
On Mon, Apr 2, 2012 at 11:04 AM, Marek Vasut wrote:
> Dear Graeme Russ,
>
>> Hi Marek,
>>
>> On Mon, Apr 2, 2012 at 10:13 AM, Marek Vasut wrote:
>> > Dear Graeme Russ,
>> >
>> >> Hi Marek,
>> >>
>> >> On Mon, Apr 2, 2012 at 9:45 AM, Marek Vasut wrote:
>> >> > Dear Graeme Russ,
>> >>
>
Dear Graeme Russ,
> Hi Marek,
>
> On Mon, Apr 2, 2012 at 10:13 AM, Marek Vasut wrote:
> > Dear Graeme Russ,
> >
> >> Hi Marek,
> >>
> >> On Mon, Apr 2, 2012 at 9:45 AM, Marek Vasut wrote:
> >> > Dear Graeme Russ,
> >>
> >> Because you just set it off - Right now, that code is assuming malloc
Hi Marek,
On Mon, Apr 2, 2012 at 10:13 AM, Marek Vasut wrote:
> Dear Graeme Russ,
>
>> Hi Marek,
>>
>> On Mon, Apr 2, 2012 at 9:45 AM, Marek Vasut wrote:
>> > Dear Graeme Russ,
>> >
>> Because you just set it off - Right now, that code is assuming malloc(0)
>> will return a valid pointer and th
Dear Graeme Russ,
> Hi Marek,
>
> On Mon, Apr 2, 2012 at 9:45 AM, Marek Vasut wrote:
> > Dear Graeme Russ,
> >
> >> Hi All
> >>
> >> Here we go again ;)
> >
> > Yay (polishing my flamethrower)!
> >
> >> On Mon, Apr 2, 2012 at 12:21 AM, Marek Vasut wrote:
> >> > Dear Joakim Tjernlund,
> >> >
Hi Marek,
On Mon, Apr 2, 2012 at 9:45 AM, Marek Vasut wrote:
> Dear Graeme Russ,
>
>> Hi All
>>
>> Here we go again ;)
>
> Yay (polishing my flamethrower)!
>
>> On Mon, Apr 2, 2012 at 12:21 AM, Marek Vasut wrote:
>> > Dear Joakim Tjernlund,
>> >
>> >> Marek Vasut wrote on 2012/04/01 16:01:56:
>
Dear Graeme Russ,
> Hi All
>
> Here we go again ;)
Yay (polishing my flamethrower)!
> On Mon, Apr 2, 2012 at 12:21 AM, Marek Vasut wrote:
> > Dear Joakim Tjernlund,
> >
> >> Marek Vasut wrote on 2012/04/01 16:01:56:
> >> > Dear Joakim Tjernlund,
> >> >
> >> > > > Dear Mike Frysinger,
> >> >
Hi All
Here we go again ;)
On Mon, Apr 2, 2012 at 12:21 AM, Marek Vasut wrote:
> Dear Joakim Tjernlund,
>
>> Marek Vasut wrote on 2012/04/01 16:01:56:
>> > Dear Joakim Tjernlund,
>> >
>> > > > Dear Mike Frysinger,
>> > > >
>> > > > > On Thursday, October 21, 2010 17:10:31 Graeme Russ wrote:
>>
Dear Joakim Tjernlund,
> Marek Vasut wrote on 2012/04/01 16:01:56:
> > Dear Joakim Tjernlund,
> >
> > > > Dear Mike Frysinger,
> > > >
> > > > > On Thursday, October 21, 2010 17:10:31 Graeme Russ wrote:
> > > > > > On 22/10/10 06:51, Mike Frysinger wrote:
> > > > > > > have u-boot return an err
Marek Vasut wrote on 2012/04/01 16:01:56:
>
> Dear Joakim Tjernlund,
>
> > > Dear Mike Frysinger,
> > >
> > > > On Thursday, October 21, 2010 17:10:31 Graeme Russ wrote:
> > > > > On 22/10/10 06:51, Mike Frysinger wrote:
> > > > > > have u-boot return an error.
> > > > >
> > > > > Is NULL what you
Dear Joakim Tjernlund,
> > Dear Mike Frysinger,
> >
> > > On Thursday, October 21, 2010 17:10:31 Graeme Russ wrote:
> > > > On 22/10/10 06:51, Mike Frysinger wrote:
> > > > > have u-boot return an error.
> > > >
> > > > Is NULL what you consider to be an error
> > >
> > > yes
> > >
> > > > Bes
>
> Dear Mike Frysinger,
>
> > On Thursday, October 21, 2010 17:10:31 Graeme Russ wrote:
> > > On 22/10/10 06:51, Mike Frysinger wrote:
> > > > have u-boot return an error.
> > >
> > > Is NULL what you consider to be an error
> >
> > yes
> >
> > > Besides, is not free(NULL) valid (does nothing) as
Dear Mike Frysinger,
> On Thursday, October 21, 2010 17:10:31 Graeme Russ wrote:
> > On 22/10/10 06:51, Mike Frysinger wrote:
> > > have u-boot return an error.
> >
> > Is NULL what you consider to be an error
>
> yes
>
> > Besides, is not free(NULL) valid (does nothing) as well?
>
> yes, free
Scott Wood wrote on 2010/10/22 19:36:33:
>
> On Fri, 22 Oct 2010 03:55:49 -0400
> Mike Frysinger wrote:
>
> > On Friday, October 22, 2010 03:37:43 Joakim Tjernlund wrote:
> > > Mike Frysinger wrote on 2010/10/22 09:20:22:
> > > > On Friday, October 22, 2010 02:10:16 Joakim Tjernlund wrote:
>
> Yo
Mike Frysinger wrote on 2010/10/22 19:06:14:
>
> On Friday, October 22, 2010 12:40:07 Joakim Tjernlund wrote:
> > Mike Frysinger wrote on 2010/10/22 17:18:05:
> > > On Friday, October 22, 2010 04:34:52 Joakim Tjernlund wrote:
> > > > Don't you want to know if the app screwed up or if the system is
On Fri, 22 Oct 2010 03:55:49 -0400
Mike Frysinger wrote:
> On Friday, October 22, 2010 03:37:43 Joakim Tjernlund wrote:
> > Mike Frysinger wrote on 2010/10/22 09:20:22:
> > > On Friday, October 22, 2010 02:10:16 Joakim Tjernlund wrote:
> > > > does not set errno which screws error handling. One h
On Friday, October 22, 2010 12:40:07 Joakim Tjernlund wrote:
> Mike Frysinger wrote on 2010/10/22 17:18:05:
> > On Friday, October 22, 2010 04:34:52 Joakim Tjernlund wrote:
> > > Don't you want to know if the app screwed up or if the system is out
> > > of memory?
> > >
> > > The only upside to ma
Mike Frysinger wrote on 2010/10/22 17:18:05:
>
> On Friday, October 22, 2010 04:34:52 Joakim Tjernlund wrote:
> > Don't you want to know if the app screwed up or if the system is out
> > of memory?
> >
> > The only upside to malloc(0) == NULL I can see is an extra check
> > for apps for which size
On Friday, October 22, 2010 04:34:52 Joakim Tjernlund wrote:
> Don't you want to know if the app screwed up or if the system is out
> of memory?
>
> The only upside to malloc(0) == NULL I can see is an extra check
> for apps for which size == 0 is an error to the app too(something the app
> should
Mike Frysinger wrote on 2010/10/22 09:55:49:
>
> On Friday, October 22, 2010 03:37:43 Joakim Tjernlund wrote:
> > Mike Frysinger wrote on 2010/10/22 09:20:22:
> > > On Friday, October 22, 2010 02:10:16 Joakim Tjernlund wrote:
> > > > does not set errno which screws error handling. One have to ben
On Friday, October 22, 2010 03:37:43 Joakim Tjernlund wrote:
> Mike Frysinger wrote on 2010/10/22 09:20:22:
> > On Friday, October 22, 2010 02:10:16 Joakim Tjernlund wrote:
> > > does not set errno which screws error handling. One have to bend over
> > > just to cope with this.
> >
> > that depend
Reinhard Meyer wrote on 2010/10/22 09:18:02:
>
> Dear Joakim Tjernlund,
> > Mike Frysinger wrote on 2010/10/21 21:51:53:
> >> On Thursday, October 21, 2010 07:45:10 Joakim Tjernlund wrote:
> >>> Wolfgang Denk wrote on 2010/10/21 13:32:54:
> Joakim Tjernlund you wrote:
> >> - if ((long)
Mike Frysinger wrote on 2010/10/22 09:20:22:
>
> On Friday, October 22, 2010 02:10:16 Joakim Tjernlund wrote:
> > Mike Frysinger wrote on 2010/10/21 21:51:53:
> > > it is useful for malloc(0) == NULL. the glibc behavior is downright
> > > obnoxious. we disable this for uClibc and dont see probl
On Friday, October 22, 2010 02:10:16 Joakim Tjernlund wrote:
> Mike Frysinger wrote on 2010/10/21 21:51:53:
> > it is useful for malloc(0) == NULL. the glibc behavior is downright
> > obnoxious. we disable this for uClibc and dont see problems. if
> > anything, we catch accidental programming mi
Dear Joakim Tjernlund,
> Mike Frysinger wrote on 2010/10/21 21:51:53:
>> On Thursday, October 21, 2010 07:45:10 Joakim Tjernlund wrote:
>>> Wolfgang Denk wrote on 2010/10/21 13:32:54:
Joakim Tjernlund you wrote:
>> - if ((long)bytes < 0) return 0;
>> + if ((long)bytes <= 0) return 0
Mike Frysinger wrote on 2010/10/21 21:51:53:
>
> On Thursday, October 21, 2010 07:45:10 Joakim Tjernlund wrote:
> > Wolfgang Denk wrote on 2010/10/21 13:32:54:
> > > Joakim Tjernlund you wrote:
> > > > > - if ((long)bytes < 0) return 0;
> > > > > + if ((long)bytes <= 0) return 0;
> > > >
> > >
On Thursday, October 21, 2010 17:10:31 Graeme Russ wrote:
> On 22/10/10 06:51, Mike Frysinger wrote:
> > have u-boot return an error.
>
> Is NULL what you consider to be an error
yes
> Besides, is not free(NULL) valid (does nothing) as well?
yes, free(NULL) should work fine per POSIX
-mike
si
On 22/10/10 06:51, Mike Frysinger wrote:
> On Thursday, October 21, 2010 07:45:10 Joakim Tjernlund wrote:
>> Wolfgang Denk wrote on 2010/10/21 13:32:54:
>>> Joakim Tjernlund you wrote:
> - if ((long)bytes < 0) return 0;
> + if ((long)bytes <= 0) return 0;
I think you should retu
On Thursday, October 21, 2010 07:45:10 Joakim Tjernlund wrote:
> Wolfgang Denk wrote on 2010/10/21 13:32:54:
> > Joakim Tjernlund you wrote:
> > > > - if ((long)bytes < 0) return 0;
> > > > + if ((long)bytes <= 0) return 0;
> > >
> > > I think you should return some impossible ptr value =! NULL
Wolfgang Denk wrote on 2010/10/21 14:02:39:
>
> Dear Joakim Tjernlund,
>
> In message 0041a...@transmode.se> you wrote:
> >
> > > Of course we could return some valid pointer like glibc does, i. e.
> > > implement something like
> > >
> > >if (size == 0)
> > > size = 8;
> > >
> > >
Dear Joakim Tjernlund,
In message
you
wrote:
>
> > Of course we could return some valid pointer like glibc does, i. e.
> > implement something like
> >
> >if (size == 0)
> > size = 8;
> >
> > or so. Do you think that would be better?
>
> Better than NULL, but best would be a ptr t
Wolfgang Denk wrote on 2010/10/21 13:51:26:
>
> Dear Joakim Tjernlund,
>
> In message 00408...@transmode.se> you wrote:
> >
> > > It is legal for malloc() to return NULL in case of size==0,
> > > and for the sake of simplicity I recommend we do just that.
> >
> > Yes, but not very useful. Glib
Dear Joakim Tjernlund,
In message
you
wrote:
>
> > It is legal for malloc() to return NULL in case of size==0,
> > and for the sake of simplicity I recommend we do just that.
>
> Yes, but not very useful. Glibc does not return NULL
Maybe not in the current implementation, and not on the archi
Wolfgang Denk wrote on 2010/10/21 13:32:54:
>
> Dear Joakim Tjernlund,
>
> In message 003ec...@transmode.se> you wrote:
> >
> > > - if ((long)bytes < 0) return 0;
> > > + if ((long)bytes <= 0) return 0;
> >
> > I think you should return some impossible ptr value =! NULL
> > Size 0 not really
Dear Joakim Tjernlund,
In message
you
wrote:
>
> > - if ((long)bytes < 0) return 0;
> > + if ((long)bytes <= 0) return 0;
>
> I think you should return some impossible ptr value =! NULL
> Size 0 not really an error.
It is legal for malloc() to return NULL in case of size==0,
and for the sa
>
> In case malloc is invoked with requested size 0, this patch will prevent
> the execution of the allocation algorithm (because it corrupts the data
> structures)
> and will return 0 to the caller.
>
> Signed-off-by: Nikolaos Kostaras
>
> ---
> common/dlmalloc.c |2 +-
> 1 files changed
In case malloc is invoked with requested size 0, this patch will prevent
the execution of the allocation algorithm (because it corrupts the data
structures)
and will return 0 to the caller.
Signed-off-by: Nikolaos Kostaras
---
common/dlmalloc.c |2 +-
1 files changed, 1 insertions(+), 1 de
75 matches
Mail list logo