mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 14:14:37 +00:00
staging: rtl8192e: return error code from rtllib_softmac_init()
[ Upstream commit68bf78ff59
] If it fails to allocate 'dot11d_info', rtllib_softmac_init() should return error code. And remove unneccessary error message. Fixes:94a799425e
("From: wlanfae <wlanfae@realtek.com>") Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Pavel Skripkin <paskripkin@gmail.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20211202030704.2425621-2-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
84e568531b
commit
9f49cf5196
2 changed files with 5 additions and 3 deletions
|
@ -1982,7 +1982,7 @@ void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee);
|
|||
void rtllib_stop_send_beacons(struct rtllib_device *ieee);
|
||||
void notify_wx_assoc_event(struct rtllib_device *ieee);
|
||||
void rtllib_start_ibss(struct rtllib_device *ieee);
|
||||
void rtllib_softmac_init(struct rtllib_device *ieee);
|
||||
int rtllib_softmac_init(struct rtllib_device *ieee);
|
||||
void rtllib_softmac_free(struct rtllib_device *ieee);
|
||||
void rtllib_disassociate(struct rtllib_device *ieee);
|
||||
void rtllib_stop_scan(struct rtllib_device *ieee);
|
||||
|
|
|
@ -2952,7 +2952,7 @@ void rtllib_start_protocol(struct rtllib_device *ieee)
|
|||
}
|
||||
}
|
||||
|
||||
void rtllib_softmac_init(struct rtllib_device *ieee)
|
||||
int rtllib_softmac_init(struct rtllib_device *ieee)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -2963,7 +2963,8 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
|
|||
ieee->seq_ctrl[i] = 0;
|
||||
ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC);
|
||||
if (!ieee->dot11d_info)
|
||||
netdev_err(ieee->dev, "Can't alloc memory for DOT11D\n");
|
||||
return -ENOMEM;
|
||||
|
||||
ieee->LinkDetectInfo.SlotIndex = 0;
|
||||
ieee->LinkDetectInfo.SlotNum = 2;
|
||||
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0;
|
||||
|
@ -3031,6 +3032,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
|
|||
(void(*)(unsigned long)) rtllib_sta_ps,
|
||||
(unsigned long)ieee);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rtllib_softmac_free(struct rtllib_device *ieee)
|
||||
|
|
Loading…
Reference in a new issue