From: Dan Carpenter <dan.carpenter@oracle.com>
To: Tuo Li <islituo@gmail.com>
Cc: gregkh@linuxfoundation.org, will+git@drnd.me,
romain.perier@gmail.com, yashsri421@gmail.com,
apais@linux.microsoft.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, baijiaju1990@gmail.com,
TOTE Robot <oslab@tsinghua.edu.cn>
Subject: Re: [PATCH] staging: rtl8192e: rtl_core: Fix possible null-pointer dereference in _rtl92e_pci_disconnect()
Date: Wed, 11 Aug 2021 09:59:37 +0300 [thread overview]
Message-ID: <20210811065937.GA1931@kadam> (raw)
In-Reply-To: <20210811031135.4110-1-islituo@gmail.com>
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@tsinghua.edu.cn>
> Signed-off-by: Tuo Li <islituo@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.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
prev parent reply other threads:[~2021-08-11 7:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-11 3:11 [PATCH] staging: rtl8192e: rtl_core: Fix possible null-pointer dereference in _rtl92e_pci_disconnect() Tuo Li
2021-08-11 6:59 ` Dan Carpenter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210811065937.GA1931@kadam \
--to=dan.carpenter@oracle.com \
--cc=apais@linux.microsoft.com \
--cc=baijiaju1990@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=islituo@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=oslab@tsinghua.edu.cn \
--cc=romain.perier@gmail.com \
--cc=will+git@drnd.me \
--cc=yashsri421@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox