lkml.org 
[lkml]   [2022]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Setting variable NULL after freeing it.
>
> It depends. What's important is not to let a pointer exist to a freed
> location, so if you're doing:
>
> kfree(card->pool);
>
> then it's usually important to follow this by:
>
> card->pool = NULL;
>

I checked in kernel but at many places this is not being done. I can
change all that code. But, will the patch be accepted?

So, if someone is doing -

kfree(x)
._some_code_
._some_code_
._some_code_

Then I can change it to -

kfree(x)
x = NULL;
._some_code_
._some_code_
._some_code_

But, will the patch be accepted for this change?

Please let me know.

Amit

\
 
 \ /
  Last update: 2022-11-12 11:49    [W:0.054 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site