diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-17 08:57:33 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:53:20 -0500 |
commit | 8bc1d21776bb012e41ed062c6d842cfe7c82998a (patch) | |
tree | 5499dedfb7033685bbd13d4852f478410878c4a2 /drivers/usb/wusbcore | |
parent | 319c3ea451e19f72b578661e26fb33739af5ae1c (diff) |
USB: wusb: check CHID is all zeros before stopping the host
An incorrect sizeof() resulted in only 4 (or 8) octets of the CHID being
checked instead of all 16 octets. A randomly generated CHID had a
probability of being unable to start a WUSB host of less than 1 in
2 billion.
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/wusbcore')
-rw-r--r-- | drivers/usb/wusbcore/mmc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/wusbcore/mmc.c b/drivers/usb/wusbcore/mmc.c index 3b52161e6e9c..2d827397e30b 100644 --- a/drivers/usb/wusbcore/mmc.c +++ b/drivers/usb/wusbcore/mmc.c | |||
@@ -263,7 +263,7 @@ int wusbhc_chid_set(struct wusbhc *wusbhc, const struct wusb_ckhdid *chid) | |||
263 | { | 263 | { |
264 | int result = 0; | 264 | int result = 0; |
265 | 265 | ||
266 | if (memcmp(chid, &wusb_ckhdid_zero, sizeof(chid)) == 0) | 266 | if (memcmp(chid, &wusb_ckhdid_zero, sizeof(*chid)) == 0) |
267 | chid = NULL; | 267 | chid = NULL; |
268 | 268 | ||
269 | mutex_lock(&wusbhc->mutex); | 269 | mutex_lock(&wusbhc->mutex); |