[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210811031135.4110-1-islituo@gmail.com>
Date: Tue, 10 Aug 2021 20:11:35 -0700
From: Tuo Li <islituo@...il.com>
To: gregkh@...uxfoundation.org, dan.carpenter@...cle.com,
will+git@...d.me, romain.perier@...il.com, yashsri421@...il.com,
apais@...ux.microsoft.com
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
baijiaju1990@...il.com, Tuo Li <islituo@...il.com>,
TOTE Robot <oslab@...nghua.edu.cn>
Subject: [PATCH] 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@...nghua.edu.cn>
Signed-off-by: Tuo Li <islituo@...il.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index e85d9c2cdc96..0eb37a95b519 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2557,8 +2557,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);
--
2.25.1
Powered by blists - more mailing lists