]>
git.karo-electronics.de Git - karo-tx-linux.git/commit
Staging: lustre: obdclass: Use kasprintf instead of kzalloc and sprintf
This patch uses kasprintf which combines kzalloc and sprintf.
kasprintf also takes care of the size calculation.
Semantic patch used is as follows:
@@
expression a,flag;
expression list args;
statement S;
@@
a =
- \(kmalloc\|kzalloc\)(...,flag)
+ kasprintf (flag,args)
<... when != a
if (a == NULL || ...) S
...>
- sprintf(a,args);
Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>