summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8712
diff options
context:
space:
mode:
authorNam Cao <namcaov@gmail.com>2022-10-25 11:12:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-31 09:08:30 +0100
commit242443430dd8ef932a56cf483080a46f2948dd65 (patch)
treed853f1d5c8bf4cc01704f6e552ec6a909ba231f8 /drivers/staging/rtl8712
parent63b5e50571ce4d87cd6c1c4d99de74c9d86fd0d8 (diff)
downloadlwn-242443430dd8ef932a56cf483080a46f2948dd65.tar.gz
lwn-242443430dd8ef932a56cf483080a46f2948dd65.zip
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: Philipp Hortmann <philipp.g.hortmann@gmail.com> Signed-off-by: Nam Cao <namcaov@gmail.com> Link: https://lore.kernel.org/r/b550803561acf26af71f2377215c28b94435a644.1666688642.git.namcaov@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r--drivers/staging/rtl8712/os_intfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c
index 12adb470d216..205b7d66a40a 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -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;