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>
This commit is contained in:
sudip 2015-11-24 13:51:38 +05:30 committed by Kalle Valo
parent 68ec581011
commit 0a38c8e1b5
1 changed files with 2 additions and 1 deletions

View File

@ -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