OSDN Git Service

[SCSI] scsi_lib: fix potential NULL dereference
authorJiri Slaby <jirislaby@gmail.com>
Wed, 23 Sep 2009 14:15:35 +0000 (16:15 +0200)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 4 Dec 2009 18:00:51 +0000 (12:00 -0600)
commit03b147083a2f9a2a3fbbd2505fa88ffa3c6ab194
tree9d0005b45bfff8d9ec23857d4e317311d6875d1b
parentf619106bdd9d197c947f07108af57946f19a7f7e
[SCSI] scsi_lib: fix potential NULL dereference

Stanse found a potential NULL dereference in scsi_kill_request.

Instead of triggering BUG() in 'if (unlikely(cmd == NULL))' branch,
the kernel will Oops earlier on cmd dereference.

Move the dereferences after the if.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/scsi_lib.c