wusb: replace memset by memzero_explicit
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 30 Nov 2014 17:03:49 +0000 (18:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2014 00:15:02 +0000 (16:15 -0800)
commiteb94ec7a6516cd1dc52c0f63d7c3a274e6337416
treedea11e9e5f49de50fbb38e982b3fad742b90d7d4
parentb19e5f04cd628c012c26a025cf93da5233df134d
wusb: replace memset by memzero_explicit

Memset on a local variable may be removed when it is called just before the
variable goes out of scope.  Using memzero_explicit defeats this
optimization.  A simplified version of the semantic patch that makes this
change is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier x;
type T;
@@

{
... when any
T x[...];
... when any
    when exists
- memset
+ memzero_explicit
  (x,
-0,
  ...)
... when != x
    when strict
}
// </smpl>

This change was suggested by Daniel Borkmann <dborkman@redhat.com>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/wusbcore/dev-sysfs.c
drivers/usb/wusbcore/security.c