Repository navigation
Commit b98fe24
batman-adv: 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:
// <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>1 parent 0a7fdbd commit b98fe24
1 file changed
Lines changed: 8 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
903 | | - | |
904 | | - | |
905 | | - | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
915 | 912 | | |
916 | 913 | | |
917 | 914 | | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | 915 | | |
922 | 916 | | |
923 | | - | |
924 | | - | |
| 917 | + | |
| 918 | + | |
925 | 919 | | |
926 | 920 | | |
927 | | - | |
928 | | - | |
929 | 921 | | |
930 | 922 | | |
931 | 923 | | |
| |||
0 commit comments