Commit 24244343 authored by Nam Cao's avatar Nam Cao Committed by Greg Kroah-Hartman

staging: rtl8712: check for return value of _r8712_init_xmit_priv()

The return value of _r8712_init_xmit_priv() is never checked and the driver
always continue execution as if all is well. This will cause problems
if, for example, buffers cannot be allocated and the driver continue and
use those buffers.

Check for return value of _r8712_init_xmit_priv() and return error (if any)
during probing.
Tested-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: default avatarNam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/b550803561acf26af71f2377215c28b94435a644.1666688642.git.namcaov@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 63b5e505
......@@ -308,7 +308,9 @@ int r8712_init_drv_sw(struct _adapter *padapter)
ret = r8712_init_mlme_priv(padapter);
if (ret)
return ret;
_r8712_init_xmit_priv(&padapter->xmitpriv, padapter);
ret = _r8712_init_xmit_priv(&padapter->xmitpriv, padapter);
if (ret)
return ret;
ret = _r8712_init_recv_priv(&padapter->recvpriv, padapter);
if (ret)
return ret;
......
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