提交 cc0a98ef 编写于 作者: Y Yang Yingliang 提交者: Zheng Zengkai

staging: rtl8192e: return error code from rtllib_softmac_init()

stable inclusion
from stable-v5.10.94
commit 49f5cd2b7c417a1dc71d45a866ea14b17ef72c4f
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=49f5cd2b7c417a1dc71d45a866ea14b17ef72c4f

--------------------------------

[ Upstream commit 68bf78ff ]

If it fails to allocate 'dot11d_info', rtllib_softmac_init()
should return error code. And remove unneccessary error message.

Fixes: 94a79942 ("From: wlanfae <wlanfae@realtek.com>")
Reviewed-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NPavel Skripkin <paskripkin@gmail.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211202030704.2425621-2-yangyingliang@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 1e1befe6
...@@ -1982,7 +1982,7 @@ void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee); ...@@ -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 rtllib_stop_send_beacons(struct rtllib_device *ieee);
void notify_wx_assoc_event(struct rtllib_device *ieee); void notify_wx_assoc_event(struct rtllib_device *ieee);
void rtllib_start_ibss(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_softmac_free(struct rtllib_device *ieee);
void rtllib_disassociate(struct rtllib_device *ieee); void rtllib_disassociate(struct rtllib_device *ieee);
void rtllib_stop_scan(struct rtllib_device *ieee); void rtllib_stop_scan(struct rtllib_device *ieee);
......
...@@ -2953,7 +2953,7 @@ void rtllib_start_protocol(struct rtllib_device *ieee) ...@@ -2953,7 +2953,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; int i;
...@@ -2964,7 +2964,8 @@ void rtllib_softmac_init(struct rtllib_device *ieee) ...@@ -2964,7 +2964,8 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
ieee->seq_ctrl[i] = 0; ieee->seq_ctrl[i] = 0;
ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC); ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC);
if (!ieee->dot11d_info) if (!ieee->dot11d_info)
netdev_err(ieee->dev, "Can't alloc memory for DOT11D\n"); return -ENOMEM;
ieee->LinkDetectInfo.SlotIndex = 0; ieee->LinkDetectInfo.SlotIndex = 0;
ieee->LinkDetectInfo.SlotNum = 2; ieee->LinkDetectInfo.SlotNum = 2;
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0; ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0;
...@@ -3030,6 +3031,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee) ...@@ -3030,6 +3031,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
tasklet_setup(&ieee->ps_task, rtllib_sta_ps); tasklet_setup(&ieee->ps_task, rtllib_sta_ps);
return 0;
} }
void rtllib_softmac_free(struct rtllib_device *ieee) void rtllib_softmac_free(struct rtllib_device *ieee)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册