[patch] fusion: fix error handling of mpt_register()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mpt_register() returns a positive int between 1 and
MPT_MAX_PROTOCOL_DRIVERS.  It returns MPT_MAX_PROTOCOL_DRIVERS if there
is no slot available.  Most places don't check the return but this is
how it's done in mptctl.c as well.

Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>

diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index cbe9607..42affb1 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -1454,7 +1454,7 @@ static int __init mpt_lan_init (void)
 
 	LanCtx = mpt_register(lan_reply, MPTLAN_DRIVER,
 				"lan_reply");
-	if (LanCtx <= 0) {
+	if (LanCtx >= MPT_MAX_PROTOCOL_DRIVERS) {
 		printk (KERN_ERR MYNAM ": Failed to register with MPT base driver\n");
 		return -EBUSY;
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux