diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-07-06 16:06:32 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-27 15:08:01 -0700 |
commit | 8665f40a06a0794517f226cad694386faf9802c3 (patch) | |
tree | 92f309f556ba1edf9c0d58c2da4bccbe51c4a507 /lib/nlattr.c | |
parent | 8bc51b4f2a42187b4386974ef92add94acafe135 (diff) |
usb: storage: return on error to avoid a null pointer dereference
commit 446230f52a5bef593554510302465eabab45a372 upstream.
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>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/nlattr.c')
0 files changed, 0 insertions, 0 deletions