summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192u
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-12-26 11:02:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-28 17:11:18 +0300
commitec36ae7189acd9a24f417e4814e627034da68922 (patch)
tree0f5b6ac3226f14968c68406bf001570f4bf2d59b /drivers/staging/rtl8192u
parent850c35bb28ecd80bdbecc5cc4d47d0c6941d6d83 (diff)
downloadlinux-ec36ae7189acd9a24f417e4814e627034da68922.tar.xz
staging: rtl8192u: Add null check in rtl8192_usb_initendpoints
There is an allocation for priv->rx_urb[16] has no null check, which may lead to a null pointer dereference. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Link: https://lore.kernel.org/r/20201226080258.6576-1-dinghao.liu@zju.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r--drivers/staging/rtl8192u/r8192U_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 93676af98629..9fc4adc83d77 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1608,6 +1608,8 @@ static short rtl8192_usb_initendpoints(struct net_device *dev)
void *oldaddr, *newaddr;
priv->rx_urb[16] = usb_alloc_urb(0, GFP_KERNEL);
+ if (!priv->rx_urb[16])
+ return -ENOMEM;
priv->oldaddr = kmalloc(16, GFP_KERNEL);
if (!priv->oldaddr)
return -ENOMEM;