mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 00:43:12 +00:00
This patch uses kasprintf which combines kmalloc and sprintf. kasprintf also takes care of the size calculation. This is done using Coccinelle. 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: Vaishali Thakkar <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>