Thread (3 messages) 3 messages, 2 authors, 2015-11-24
STALE3846d

[PATCH] libertas: fix possible NULL dereference

From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: 2015-11-23 12:32:12
Also in: linux-wireless, lkml
Subsystem: marvell libertas wireless driver, the rest · Maintainer: Linus Torvalds

We were dereferencing cmd first and checking for NULL later. Lets first
check for NULL.

Signed-off-by: Sudip Mukherjee <redacted>
---
 drivers/net/wireless/marvell/libertas/cfg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c
index 8317afd..e38ad1d 100644
--- a/drivers/net/wireless/marvell/libertas/cfg.c
+++ b/drivers/net/wireless/marvell/libertas/cfg.c
@@ -1108,7 +1108,7 @@ static int lbs_associate(struct lbs_private *priv,
 	size_t len, resp_ie_len;
 	int status;
 	int ret;
-	u8 *pos = &(cmd->iebuf[0]);
+	u8 *pos;
 	u8 *tmp;
 
 	lbs_deb_enter(LBS_DEB_CFG80211);
@@ -1117,6 +1117,7 @@ static int lbs_associate(struct lbs_private *priv,
 		ret = -ENOMEM;
 		goto done;
 	}
+	pos = &cmd->iebuf[0];
 
 	/*
 	 * cmd              50 00
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help