netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] libertas: check for NULL before use
@ 2015-11-24  8:21 Sudip Mukherjee
  2015-11-26 13:05 ` [v2] " Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2015-11-24  8:21 UTC (permalink / raw)
  To: Kalle Valo
  Cc: linux-kernel, libertas-dev, linux-wireless, netdev,
	Andy Shevchenko, Sudip Mukherjee

If kzalloc fails it will return NULL. Lets check for NULL first before
using the pointer.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

v2: commit message changed

 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [v2] libertas: check for NULL before use
  2015-11-24  8:21 [PATCH v2] libertas: check for NULL before use Sudip Mukherjee
@ 2015-11-26 13:05 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-11-26 13:05 UTC (permalink / raw)
  To: sudip
  Cc: linux-kernel, libertas-dev, linux-wireless, netdev,
	Andy Shevchenko, Sudip Mukherjee


> If kzalloc fails it will return NULL. Lets check for NULL first before
> using the pointer.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-26 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-24  8:21 [PATCH v2] libertas: check for NULL before use Sudip Mukherjee
2015-11-26 13:05 ` [v2] " Kalle Valo

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).