kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] fusion: fix error handling of mpt_register()
@ 2010-08-06  6:34 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-08-06  6:34 UTC (permalink / raw)
  To: Eric Moore
  Cc: support, Alexey Dobriyan, James Bottomley, Kashyap Desai,
	DL-MPTFusionLinux, linux-scsi, kernel-janitors

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@gmail.com>

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;
 	}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-06  6:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-06  6:34 [patch] fusion: fix error handling of mpt_register() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).