Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] Add scsi_add_host() failure handling for nsp32

Add scsi_add_host() failure handling for nsp32
and silence warning.
drivers/scsi/nsp32.c:2888: warning: ignoring return value of 'Scsi_add_host', declared with attribute warn_unused_result

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: GOTO Masanori <gotom@sanori.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

GOTO Masanori and committed by
James Bottomley
3e7196cf 041976fb

+8 -1
+8 -1
drivers/scsi/nsp32.c
··· 2886 2886 } 2887 2887 2888 2888 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) 2889 - scsi_add_host (host, &PCIDEV->dev); 2889 + ret = scsi_add_host(host, &PCIDEV->dev); 2890 + if (ret) { 2891 + nsp32_msg(KERN_ERR, "failed to add scsi host"); 2892 + goto free_region; 2893 + } 2890 2894 scsi_scan_host(host); 2891 2895 #endif 2892 2896 pci_set_drvdata(PCIDEV, host); 2893 2897 return DETECT_OK; 2898 + 2899 + free_region: 2900 + release_region(host->io_port, host->n_io_port); 2894 2901 2895 2902 free_irq: 2896 2903 free_irq(host->irq, data);