Commit 9fcee167 authored by Xiaoke Wang's avatar Xiaoke Wang Committed by Greg Kroah-Hartman

staging: r8188eu: add a check for rtw_cbuf_alloc()

kmalloc() is called by rtw_cbuf_alloc() and it returns pointer of
srtuct rtw_cbuf, NULL for allocation failure. So it is better to check
the return value of it.
Signed-off-by: default avatarXiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_D95ACC78B93B1CDD14C4E13E4A66FF892008@qq.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f6ca689d
......@@ -69,6 +69,8 @@ static int _rtw_init_evt_priv(struct evt_priv *pevtpriv)
INIT_WORK(&pevtpriv->c2h_wk, c2h_wk_callback);
pevtpriv->c2h_wk_alive = false;
pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
if (!pevtpriv->c2h_queue)
res = _FAIL;
return res;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment