[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210811065937.GA1931@kadam>
Date: Wed, 11 Aug 2021 09:59:37 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Tuo Li <islituo@...il.com>
Cc: gregkh@...uxfoundation.org, will+git@...d.me,
romain.perier@...il.com, yashsri421@...il.com,
apais@...ux.microsoft.com, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org, baijiaju1990@...il.com,
TOTE Robot <oslab@...nghua.edu.cn>
Subject: Re: [PATCH] staging: rtl8192e: rtl_core: Fix possible null-pointer
dereference in _rtl92e_pci_disconnect()
On Tue, Aug 10, 2021 at 08:11:35PM -0700, Tuo Li wrote:
> 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>
Reviewed-by: Dan Carpenter <dan.carpenter@...cle.com>
Smatch was not smart enough to spot the dereference inside rtllib_priv().
Fortunately, the "dev" variable can't be NULL at this point.
regards,
dan carpenter
Powered by blists - more mailing lists