Commit f47eb147 authored by Matthew Dharm's avatar Matthew Dharm Committed by Greg Kroah-Hartman

[PATCH] USB storage: avoid NULL-ptr OOPS

This patch will avoid a NULL-pointer dereference OOPS which is caused by
oddly-formed (yet legal) INQUIRY commands that request 0 bytes.
parent 11d08a01
......@@ -82,6 +82,10 @@ static void fix_inquiry_data(Scsi_Cmnd *srb)
if (srb->cmnd[0] != INQUIRY)
return;
/* oddly short buffer -- bail out */
if (srb->request_bufflen < 3)
return;
data_ptr = find_data_location(srb);
if ((data_ptr[2] & 7) == 2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment