]> git.karo-electronics.de Git - karo-tx-linux.git/commit
checkpatch: add check for reuse of krealloc arg
authorJoe Perches <joe@perches.com>
Tue, 26 Mar 2013 23:25:05 +0000 (10:25 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Apr 2013 06:12:29 +0000 (17:12 +1100)
commit4b4989a93a01653804581ccd59635a7eaa286607
treed8081d8238412a8651dfae401cc5182629a9a416
parentad86d3d1ff3c9b8018bea08e1b84910c5a61c886
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