1
0
Fork 0
alistair23-linux/drivers/usb/storage
Colin Ian King 446230f52a usb: storage: return on error to avoid a null pointer dereference
When us->extra is null the driver is not initialized, however, a
later call to osd200_scsi_to_ata is made that dereferences
us->extra, causing a null pointer dereference.  The code
currently detects and reports that the driver is not initialized;
add a return to avoid the subsequent dereference issue in this
check.

Thanks to Alan Stern for pointing out that srb->result needs setting
to DID_ERROR << 16

Detected by CoverityScan, CID#100308 ("Dereference after null check")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-17 13:11:57 +02:00
..
Kconfig
Makefile
alauda.c usb: storage: alauda: don't print on ENOMEM 2016-08-30 19:17:39 +02:00
cypress_atacb.c
datafab.c
debug.c
debug.h
ene_ub6250.c Merge 4.12-rc2 into usb-next 2017-05-22 09:00:23 +02:00
freecom.c
initializers.c
initializers.h
isd200.c usb: storage: return on error to avoid a null pointer dereference 2017-07-17 13:11:57 +02:00
jumpshot.c
karma.c usb: storage: karma: remove useless variable 2017-03-17 13:27:41 +09:00
onetouch.c
option_ms.c
option_ms.h
protocol.c
protocol.h
realtek_cr.c
scsiglue.c scsi: introduce a quirk for false cache reporting 2016-09-13 08:08:24 +02:00
scsiglue.h
sddr09.c usb: storage: sddr09: Remove a set-but-not-used variable 2017-01-25 10:52:43 +01:00
sddr55.c
shuttle_usbat.c
sierra_ms.c
sierra_ms.h
transport.c Fix USB CB/CBI storage devices with CONFIG_VMAP_STACK=y 2016-11-15 11:08:51 +01:00
transport.h
uas-detect.h
uas.c
unusual_alauda.h
unusual_cypress.h
unusual_datafab.h
unusual_devs.h USB: storage: e-mail update in drivers/usb/storage/unusual_devs.h 2017-04-25 20:01:23 +02:00
unusual_ene_ub6250.h
unusual_freecom.h
unusual_isd200.h
unusual_jumpshot.h
unusual_karma.h
unusual_onetouch.h
unusual_realtek.h
unusual_sddr09.h
unusual_sddr55.h
unusual_uas.h
unusual_usbat.h
usb.c USB: storage: refactor endpoint retrieval 2017-03-23 13:54:08 +01:00
usb.h
usual-tables.c