public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Setting variable NULL after freeing it.
@ 2022-11-12  6:17 A
  2022-11-12  7:47 ` Willy Tarreau
  0 siblings, 1 reply; 7+ messages in thread
From: A @ 2022-11-12  6:17 UTC (permalink / raw)
  To: linux-kernel

Hi,

I am writing a linux kernel driver for a new device.

Is it a good practice to set variable NULL after freeing it?

Something like this -

kfree(x);
x = NULL;

Please let me know.

Amit

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-12 12:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-12  6:17 Setting variable NULL after freeing it A
2022-11-12  7:47 ` Willy Tarreau
2022-11-12 10:48   ` A
2022-11-12 11:34     ` Willy Tarreau
2022-11-12 11:58       ` A
2022-11-12 12:01         ` Willy Tarreau
2022-11-12 12:15           ` A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox