summaryrefslogtreecommitdiffstats
path: root/drivers/usb/wusbcore/dev-sysfs.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2014-11-30 18:03:49 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-12-02 16:15:02 -0800
commiteb94ec7a6516cd1dc52c0f63d7c3a274e6337416 (patch)
treedea11e9e5f49de50fbb38e982b3fad742b90d7d4 /drivers/usb/wusbcore/dev-sysfs.c
parentb19e5f04cd628c012c26a025cf93da5233df134d (diff)
downloadop-kernel-dev-eb94ec7a6516cd1dc52c0f63d7c3a274e6337416.zip
op-kernel-dev-eb94ec7a6516cd1dc52c0f63d7c3a274e6337416.tar.gz
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>
Diffstat (limited to 'drivers/usb/wusbcore/dev-sysfs.c')
-rw-r--r--drivers/usb/wusbcore/dev-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/wusbcore/dev-sysfs.c b/drivers/usb/wusbcore/dev-sysfs.c
index 1018345..415b140 100644
--- a/drivers/usb/wusbcore/dev-sysfs.c
+++ b/drivers/usb/wusbcore/dev-sysfs.c
@@ -101,7 +101,7 @@ static ssize_t wusb_ck_store(struct device *dev,
if (wusbhc == NULL)
return -ENODEV;
result = wusb_dev_4way_handshake(wusbhc, usb_dev->wusb_dev, &ck);
- memset(&ck, 0, sizeof(ck));
+ memzero_explicit(&ck, sizeof(ck));
wusbhc_put(wusbhc);
return result < 0 ? result : size;
}
OpenPOWER on IntegriCloud