[SCSI] Fix module removal/device add race

This patch (as546) fixes an oops-causing failure to check the return code
from scsi_device_get. The call can return an error if the LLD is being
unloaded from memory.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by Alan Stern and committed by James Bottomley b70d37bf f631b4be

+6 -2
+6 -2
drivers/scsi/scsi_scan.c
··· 870 870 out_free_sdev: 871 871 if (res == SCSI_SCAN_LUN_PRESENT) { 872 872 if (sdevp) { 873 - scsi_device_get(sdev); 874 - *sdevp = sdev; 873 + if (scsi_device_get(sdev) == 0) { 874 + *sdevp = sdev; 875 + } else { 876 + __scsi_remove_device(sdev); 877 + res = SCSI_SCAN_NO_RESPONSE; 878 + } 875 879 } 876 880 } else { 877 881 if (sdev->host->hostt->slave_destroy)