Skip to content

Commit

Permalink
staging: rtl8712: check for return value of _r8712_init_xmit_priv()
Browse files Browse the repository at this point in the history
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: Philipp Hortmann <[email protected]>
Signed-off-by: Nam Cao <[email protected]>
Link: https://lore.kernel.org/r/b550803561acf26af71f2377215c28b94435a644.1666688642.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
covanam authored and gregkh committed Oct 31, 2022
1 parent 63b5e50 commit 2424434
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/rtl8712/os_intfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2424434

Please sign in to comment.