batman-adv: Use kasprintf
authorHimangi Saraogi <himangi774@gmail.com>
Sat, 28 Jun 2014 18:36:29 +0000 (00:06 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jul 2014 00:00:31 +0000 (17:00 -0700)
kasprintf combines kmalloc and sprintf, and takes care of the size
calculation itself.

The semantic patch that makes this change is as follows:

// <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: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>

No differences found