]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.fixes/scsi-fixup-scsi_host_lookup-return-value
Updated xen patches taken from suse.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / scsi-fixup-scsi_host_lookup-return-value
1 From: Hannes Reinecke <hare@suse.de>
2 Subject: Fixup return value in scsi_host_lookup()
3 References: bnc#468654
4
5 scsi_host_lookup should always return an ERR_PTR() value if
6 it fails. This has changed in mainline where it returns a
7 NULL pointer on failure, but changing it now would be a
8 nasty kabi breakage. So stick with the established usage.
9
10 Signed-off-by: Hannes Reinecke <hare@suse.de>
11
12 --- linux-2.6.27-SLE11_BRANCH/drivers/scsi/hosts.c.orig 2008-10-10 00:13:53.000000000 +0200
13 +++ linux-2.6.27-SLE11_BRANCH/drivers/scsi/hosts.c 2009-02-05 11:23:43.910605056 +0100
14 @@ -464,7 +464,7 @@ static int __scsi_host_match(struct devi
15 struct Scsi_Host *scsi_host_lookup(unsigned short hostnum)
16 {
17 struct device *cdev;
18 - struct Scsi_Host *shost = ERR_PTR(-ENXIO);
19 + struct Scsi_Host *shost = NULL;
20
21 cdev = class_find_device(&shost_class, NULL, &hostnum,
22 __scsi_host_match);
23 @@ -472,7 +472,7 @@ struct Scsi_Host *scsi_host_lookup(unsig
24 shost = scsi_host_get(class_to_shost(cdev));
25 put_device(cdev);
26 }
27 - return shost;
28 + return shost ? shost : ERR_PTR(-ENXIO);
29 }
30 EXPORT_SYMBOL(scsi_host_lookup);
31