diff options
author | Julia Lawall <julia@diku.dk> | 2010-03-10 12:15:01 +0100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-04-07 10:00:42 +0200 |
commit | 43caa61f154da85a620965f3f61c2f45366d8dc7 (patch) | |
tree | ea487c9de02013c1b5d4fad8d1fde7517244bf17 /arch/powerpc/kernel/vio.c | |
parent | powerpc/pseries/dlpar: Eliminate use after free (diff) | |
download | linux-43caa61f154da85a620965f3f61c2f45366d8dc7.tar.xz linux-43caa61f154da85a620965f3f61c2f45366d8dc7.zip |
powerpc/pseries/dlpar: Use kasprintf
kasprintf combines kmalloc and sprintf, and takes care of the size
calculation itself.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression a,flag;
expression list args;
statement S;
@@
a =
- \(kmalloc\|kzalloc\)(...,flag)
+ kasprintf(flag,args)
<... when != a
if (a == NULL || ...) S
...>
- sprintf(a,args);
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Nathan Fontenot <nfont@austin.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
0 files changed, 0 insertions, 0 deletions