]> git.karo-electronics.de Git - karo-tx-linux.git/commit
checkpatch: add check for reuse of krealloc arg
authorJoe Perches <joe@perches.com>
Wed, 20 Mar 2013 04:07:45 +0000 (15:07 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:34:04 +0000 (16:34 +1100)
commit5fc7f49b5d1d7aabcd25596b18f115f76c45676b
treec4dafe7ce2b272612318e8876776b253c578d3ce
parent98dc5e345be094bd9ac347a5fa9e4b2142e7a4f3
checkpatch: add check for reuse of krealloc arg

On Thu, 2013-03-14 at 13:30 +0000, David Woodhouse wrote:
> If krealloc() returns NULL, it *doesn't* free the original. So any code
> of the form 'foo = krealloc(foo, …);' is almost certainly a bug.

So add a check for it to checkpatch.

Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl