Staging: lustre: obdclass: Use kasprintf
authorShraddha Barke <shraddha.6596@gmail.com>
Tue, 4 Aug 2015 20:22:45 +0000 (01:52 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2015 19:18:01 +0000 (12:18 -0700)
commit4f016420d368480762061632f9a9254fd3a89239
tree1d760b63668d78c9b73f2bbf184d6c191c8f329f
parent91f2208c37ab08343b118601eaa0d9bb76fc8762
Staging: lustre: obdclass: Use kasprintf

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>
drivers/staging/lustre/lustre/obdclass/obd_mount.c