[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1102032224110.1369@swampdragon.chaosbits.net>
Date: Thu, 3 Feb 2011 22:27:09 +0100 (CET)
From: Jesper Juhl <jj@...osbits.net>
To: netdev@...r.kernel.org
cc: linux-drivers@...verengines.com, linux-kernel@...r.kernel.org,
Ajit Khaparde <ajitk@...verengines.com>,
Sarveshwar Bandi <sarveshwarb@...verengines.com>,
Subbu Seetharaman <subbus@...verengines.com>,
Sathya Perla <sathyap@...verengines.com>
Subject: [PATCH] ServerEngines, benet: Avoid potential null deref in
be_cmd_get_seeprom_data()
wrb_from_mccq() may return null, so we may crash on a null deref in
be_cmd_get_seeprom_data().
This avoids that potential crash.
Signed-off-by: Jesper Juhl <jj@...osbits.net>
---
be_cmds.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 0c7811f..ec4a21d 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -1786,6 +1786,8 @@ int be_cmd_get_seeprom_data(struct be_adapter *adapter,
spin_lock_bh(&adapter->mcc_lock);
wrb = wrb_from_mccq(adapter);
+ if (!wrb)
+ return -EBUSY;
req = nonemb_cmd->va;
sge = nonembedded_sgl(wrb);
--
Jesper Juhl <jj@...osbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists