]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/suse-2.6.27.31/patches.fixes/scsi-check-host-lookup-failure
Move xen patchset to new version's subdir.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / scsi-check-host-lookup-failure
CommitLineData
00e5a55c
BS
1From: Laurie Barry <laurie.barry@emulex.com>
2Subject: Correct scsi_host_lookup return value
3References: bnc#456532
4
5In the scsi_generic_msg_handler routine it make a call to scsi_host_lookup and
6checks the return value for NULL, but the scsi_host_lookup routine can return
7an error when it fails instead of NULL. So when the scsi_host_lookup fails the
8scsi_generic_msg_handler crashes the kernel with "BUG: unable to handle kernel
9NULL pointer dereference at 00000000000000aa"
10
11Signed-off-by: Laurie Barry <laurie.barry@emulex.com>
12Signed-off-by: Hannes Reinecke <hare@suse.de>
13
14diff --git a/drivers/scsi/scsi_netlink.c b/drivers/scsi/scsi_netlink.c
15index b37e133..760bd23 100644
16--- a/drivers/scsi/scsi_netlink.c
17+++ b/drivers/scsi/scsi_netlink.c
18@@ -261,7 +261,7 @@ scsi_generic_msg_handler(struct sk_buff *skb)
19
20 /* if successful, scsi_host_lookup takes a shost reference */
21 shost = scsi_host_lookup(msg->host_no);
22- if (!shost) {
23+ if (IS_ERR(shost)) {
24 err = -ENODEV;
25 goto driver_exit;
26 }