staging: rtl8723au: cfg80211_rtw_add_key() return -ENOMEM on kmalloc failure
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f844717c6a
commit
6f1c59bf2c
1 changed files with 3 additions and 3 deletions
|
@ -1077,7 +1077,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
|
||||||
{
|
{
|
||||||
char *alg_name;
|
char *alg_name;
|
||||||
u32 param_len;
|
u32 param_len;
|
||||||
struct ieee_param *param = NULL;
|
struct ieee_param *param;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy);
|
struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy);
|
||||||
struct rtw_adapter *padapter = wiphy_to_adapter(wiphy);
|
struct rtw_adapter *padapter = wiphy_to_adapter(wiphy);
|
||||||
|
@ -1093,8 +1093,8 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
|
||||||
|
|
||||||
param_len = sizeof(struct ieee_param) + params->key_len;
|
param_len = sizeof(struct ieee_param) + params->key_len;
|
||||||
param = kzalloc(param_len, GFP_KERNEL);
|
param = kzalloc(param_len, GFP_KERNEL);
|
||||||
if (param == NULL)
|
if (!param)
|
||||||
return -1;
|
return -ENOMEM;
|
||||||
|
|
||||||
param->cmd = IEEE_CMD_SET_ENCRYPTION;
|
param->cmd = IEEE_CMD_SET_ENCRYPTION;
|
||||||
eth_broadcast_addr(param->sta_addr);
|
eth_broadcast_addr(param->sta_addr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue