usb: raw-gadget: use kzalloc
authorJulia Lawall <Julia.Lawall@inria.fr>
Sat, 12 Mar 2022 10:27:05 +0000 (11:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Mar 2022 14:24:36 +0000 (15:24 +0100)
commitbeb8518e26625a0ab06782519b1d0da429542b22
treeb765011a10befe485d9f39b7c9007e15f74b7285
parent32d8bb3ed80b6b8eda50d75ae2475e2e9b6113d2
usb: raw-gadget: use kzalloc

Use kzalloc instead of kmalloc + memset.

The semantic patch that makes this change is:
(https://coccinelle.gitlabpages.inria.fr/website/)

//<smpl>
@@
expression res, size, flag;
@@
- res = kmalloc(size, flag);
+ res = kzalloc(size, flag);
  ...
- memset(res, 0, size);
//</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/20220312102705.71413-7-Julia.Lawall@inria.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/legacy/raw_gadget.c