diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-12-26 16:02:56 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-28 15:11:18 +0100 |
commit | ec36ae7189acd9a24f417e4814e627034da68922 (patch) | |
tree | 0f5b6ac3226f14968c68406bf001570f4bf2d59b /drivers/staging | |
parent | 850c35bb28ecd80bdbecc5cc4d47d0c6941d6d83 (diff) | |
download | linux-stable-ec36ae7189acd9a24f417e4814e627034da68922.tar.gz linux-stable-ec36ae7189acd9a24f417e4814e627034da68922.tar.bz2 linux-stable-ec36ae7189acd9a24f417e4814e627034da68922.zip |
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')
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_core.c | 2 |
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; |