On Jan 1 2007 22:40, Ingo Oeser wrote:
>On Monday, 1. January 2007 17:25, Andreas Schwab wrote:
>> Ingo Oeser <[EMAIL PROTECTED]> writes:
>> > Then this works, because the side effect (+20) is evaluated only once.
>>
>> It's not a side effect, it's a non-lvalue, and you can't take the address
On Monday, 1. January 2007 17:25, Andreas Schwab wrote:
> Ingo Oeser <[EMAIL PROTECTED]> writes:
> > Then this works, because the side effect (+20) is evaluated only once.
>
> It's not a side effect, it's a non-lvalue, and you can't take the address
> of a non-lvalue.
Just verified this. So If
Hi!
> > I decided to keep it simple. If someone is calling kfree_nullify() with
> > anything other than a
> > simple variable, then they should call kfree().
>
> kfree_nullify() has to replace kfree() to be of any use one day. So this is
> not an option.
>
Doing kfree() that writes to its
Ingo Oeser <[EMAIL PROTECTED]> writes:
> Hi,
>
> On Monday, 1. January 2007 07:37, Amit Choudhary wrote:
>> --- Ingo Oeser <[EMAIL PROTECTED]> wrote:
>> > #define kfree_nullify(x) do { \
>> >if (__builtin_constant_p(x)) { \
>> >kfree(x); \
>> >} else { \
>> >
Hi,
On Monday, 1. January 2007 07:37, Amit Choudhary wrote:
> --- Ingo Oeser <[EMAIL PROTECTED]> wrote:
> > #define kfree_nullify(x) do { \
> > if (__builtin_constant_p(x)) { \
> > kfree(x); \
> > } else { \
> > typeof(x) *__addr_x = \
Ok, I should change that
Hi,
On Monday, 1. January 2007 07:37, Amit Choudhary wrote:
--- Ingo Oeser [EMAIL PROTECTED] wrote:
#define kfree_nullify(x) do { \
if (__builtin_constant_p(x)) { \
kfree(x); \
} else { \
typeof(x) *__addr_x = x; \
Ok, I should change that line to
Ingo Oeser [EMAIL PROTECTED] writes:
Hi,
On Monday, 1. January 2007 07:37, Amit Choudhary wrote:
--- Ingo Oeser [EMAIL PROTECTED] wrote:
#define kfree_nullify(x) do { \
if (__builtin_constant_p(x)) { \
kfree(x); \
} else { \
typeof(x) *__addr_x = x; \
Hi!
I decided to keep it simple. If someone is calling kfree_nullify() with
anything other than a
simple variable, then they should call kfree().
kfree_nullify() has to replace kfree() to be of any use one day. So this is
not an option.
Doing kfree() that writes to its argument is
On Monday, 1. January 2007 17:25, Andreas Schwab wrote:
Ingo Oeser [EMAIL PROTECTED] writes:
Then this works, because the side effect (+20) is evaluated only once.
It's not a side effect, it's a non-lvalue, and you can't take the address
of a non-lvalue.
Just verified this. So If we
On Jan 1 2007 22:40, Ingo Oeser wrote:
On Monday, 1. January 2007 17:25, Andreas Schwab wrote:
Ingo Oeser [EMAIL PROTECTED] writes:
Then this works, because the side effect (+20) is evaluated only once.
It's not a side effect, it's a non-lvalue, and you can't take the address
of a
--- Ingo Oeser <[EMAIL PROTECTED]> wrote:
> On Sunday, 31. December 2006 14:38, Bernd Petrovitsch wrote:
> > That depends on the decision/definition if (so called) "double free" is
> > an error or not (and "free(NULL)" must work in POSIX-compliant
> > environments).
>
> A double free of
In article <[EMAIL PROTECTED]> (at Mon, 1 Jan 2007 01:43:00 +0100), Ingo Oeser
<[EMAIL PROTECTED]> says:
> On Sunday, 31. December 2006 14:38, Bernd Petrovitsch wrote:
> > That depends on the decision/definition if (so called) "double free" is
> > an error or not (and "free(NULL)" must work in
On Sunday, 31. December 2006 14:38, Bernd Petrovitsch wrote:
> That depends on the decision/definition if (so called) "double free" is
> an error or not (and "free(NULL)" must work in POSIX-compliant
> environments).
A double free of non-NULL is certainly an error.
So the idea of setting it to
On Thu, 2006-12-28 at 09:54 +0100, Jan Engelhardt wrote:
> On Dec 27 2006 17:10, Pavel Machek wrote:
>
> >> Was just wondering if the _var_ in kfree(_var_) could be set to
> >> NULL after its freed. It may solve the problem of accessing some
> >> freed memory as the kernel will crash since _var_
On Thu, 2006-12-28 at 09:54 +0100, Jan Engelhardt wrote:
On Dec 27 2006 17:10, Pavel Machek wrote:
Was just wondering if the _var_ in kfree(_var_) could be set to
NULL after its freed. It may solve the problem of accessing some
freed memory as the kernel will crash since _var_ was set to
On Sunday, 31. December 2006 14:38, Bernd Petrovitsch wrote:
That depends on the decision/definition if (so called) double free is
an error or not (and free(NULL) must work in POSIX-compliant
environments).
A double free of non-NULL is certainly an error.
So the idea of setting it to NULL is
In article [EMAIL PROTECTED] (at Mon, 1 Jan 2007 01:43:00 +0100), Ingo Oeser
[EMAIL PROTECTED] says:
On Sunday, 31. December 2006 14:38, Bernd Petrovitsch wrote:
That depends on the decision/definition if (so called) double free is
an error or not (and free(NULL) must work in
--- Ingo Oeser [EMAIL PROTECTED] wrote:
On Sunday, 31. December 2006 14:38, Bernd Petrovitsch wrote:
That depends on the decision/definition if (so called) double free is
an error or not (and free(NULL) must work in POSIX-compliant
environments).
A double free of non-NULL is certainly
On Dec 27 2006 17:10, Pavel Machek wrote:
>> Was just wondering if the _var_ in kfree(_var_) could be set to
>> NULL after its freed. It may solve the problem of accessing some
>> freed memory as the kernel will crash since _var_ was set to NULL.
>>
>> Does this make sense? If yes, then how
Hi!
> Was just wondering if the _var_ in kfree(_var_) could be set to NULL after
> its freed. It may solve
> the problem of accessing some freed memory as the kernel will crash since
> _var_ was set to NULL.
>
> Does this make sense? If yes, then how about renaming kfree to something else
>
Hi!
Was just wondering if the _var_ in kfree(_var_) could be set to NULL after
its freed. It may solve
the problem of accessing some freed memory as the kernel will crash since
_var_ was set to NULL.
Does this make sense? If yes, then how about renaming kfree to something else
and
On Dec 27 2006 17:10, Pavel Machek wrote:
Was just wondering if the _var_ in kfree(_var_) could be set to
NULL after its freed. It may solve the problem of accessing some
freed memory as the kernel will crash since _var_ was set to NULL.
Does this make sense? If yes, then how about
Hi,
Was just wondering if the _var_ in kfree(_var_) could be set to NULL after its
freed. It may solve
the problem of accessing some freed memory as the kernel will crash since _var_
was set to NULL.
Does this make sense? If yes, then how about renaming kfree to something else
and providing a
Hi,
Was just wondering if the _var_ in kfree(_var_) could be set to NULL after its
freed. It may solve
the problem of accessing some freed memory as the kernel will crash since _var_
was set to NULL.
Does this make sense? If yes, then how about renaming kfree to something else
and providing a
24 matches
Mail list logo