diff options
| author | Tuo Li <islituo@gmail.com> | 2021-08-11 06:11:35 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-11 10:43:44 +0300 |
| commit | 25ee7e89d45debc195cc8cec2483e07bbccd1472 (patch) | |
| tree | 7022565f7d9207594848a172508a42c505bb8c9b | |
| parent | 3a330ece235e8d2647d7e9e287e226d77b7cae9f (diff) | |
| download | linux-25ee7e89d45debc195cc8cec2483e07bbccd1472.tar.xz | |
staging: rtl8192e: rtl_core: Fix possible null-pointer dereference in _rtl92e_pci_disconnect()
The variable dev is checked in:
if (dev)
This indicates that it can be NULL. If so, a null-pointer dereference will
occur:
priv = rtllib_priv(dev);
However, the value of priv is not used in the remaining part of this
function. Thus the else-branch can be removed to fix this posible
null-pointer dereference.
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tuo Li <islituo@gmail.com>
Link: https://lore.kernel.org/r/20210811031135.4110-1-islituo@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index dffae61b517b..a7dd1578b2c6 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -2556,8 +2556,6 @@ static void _rtl92e_pci_disconnect(struct pci_dev *pdev) release_mem_region(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1)); } - } else { - priv = rtllib_priv(dev); } pci_disable_device(pdev); |
