Re: [PATCH] [DISCUSS] Make the variable NULL after freeing it.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Oeser
Date: Monday, January 1, 2007 - 2:40 pm

On Monday, 1. January 2007 17:25, Andreas Schwab wrote:
=20

Just verified this. So If we cannot make it work in all cases, it will
cause more problems then it will solve.

So we are left with a function, which will=20
a) only be used by janitors to provide "kfree(x); x =3D NULL;"=20
    with an macro KFREE(x) in all the simple cases.

b) be used by developers, who are aware of the fact that reusable
    pointer values should set to NULL after kfree().

Doing a) and b) is "running into open doors", so doesn't prevent any
error, obfuscates code more and works only sometimes.

I give up here and would vote for dropping that idea then.


Regards

Ingo Oeser
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 4/7] work_on_cpu: use in drivers/pci/pci-driver.c, Rusty Russell, (Wed Dec 31, 5:00 pm)
Re: [PATCH] [DISCUSS] Make the variable NULL after freeing it., Ingo Oeser, (Mon Jan 1, 2:40 pm)