diff options
author | sudip <sudipm.mukherjee@gmail.com> | 2015-11-24 11:21:38 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-11-26 16:05:10 +0300 |
commit | 0a38c8e1b592c16d959da456f425053e323a5153 (patch) | |
tree | 8c247b4c3378a81e94815b04ab6da88e94a987d1 /drivers/net/wireless/marvell | |
parent | 68ec581011ae0cf84392e7b22b05dc63818e4e6d (diff) | |
download | linux-0a38c8e1b592c16d959da456f425053e323a5153.tar.xz |
libertas: check for NULL before use
If kzalloc fails it will return NULL. Lets check for NULL first before
using the pointer.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell')
-rw-r--r-- | drivers/net/wireless/marvell/libertas/cfg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c index 8317afd065b4..86955c416b30 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 |