USB: usb-storage: fix bug in fill_inquiry
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 7 Dec 2009 21:47:43 +0000 (16:47 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 22:02:54 +0000 (14:02 -0800)
commit5a2ec9e5ec191d610d56433f3801b7fb9e250872
treee5c29b066ffd5c4f1bc742f294f3506c6f3729c5
parentacb34e4d6b5d0601530e1dd10121a1ae209e3a44
USB: usb-storage: fix bug in fill_inquiry

commit f3f6faa9edf67c1018270793e0547b0f81abb47e upstream.

This patch (as1312) fixes a minor bug in usb-storage.  The
fill_inquiry() routine neglects to pre-load the inquiry data buffer
with spaces.  As a result, if the vendor name is shorter than 8
characters or the product name is shorter than 16, the remainder will
be filled with garbage.

The patch also removes some unnecessary calls to strlen().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/usb.c