From: Coiby Xu <coiby.xu@gmail.com>
To: Colin King <colin.king@canonical.com>
Cc: Manish Chopra <manishc@marvell.com>,
GR-Linux-NIC-Dev@marvell.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
netdev@vger.kernel.org, devel@driverdev.osuosl.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH][next] staging: qlge: fix read of an uninitialized pointer
Date: Wed, 3 Feb 2021 21:50:09 +0800 [thread overview]
Message-ID: <20210203135009.4boh3fhpaydysxej@Rk> (raw)
In-Reply-To: <20210203133834.22388-1-colin.king@canonical.com>
On Wed, Feb 03, 2021 at 01:38:34PM +0000, Colin King wrote:
>From: Colin Ian King <colin.king@canonical.com>
>
>Currently the pointer 'reporter' is not being initialized and is
>being read in a netdev_warn message. The pointer is not used
>and is redundant, fix this by removing it and replacing the reference
>to it with priv->reporter instead.
>
>Addresses-Coverity: ("Uninitialized pointer read")
>Fixes: 1053c27804df ("staging: qlge: coredump via devlink health reporter")
>Signed-off-by: Colin Ian King <colin.king@canonical.com>
>---
> drivers/staging/qlge/qlge_devlink.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/drivers/staging/qlge/qlge_devlink.c b/drivers/staging/qlge/qlge_devlink.c
>index c6ef5163e241..86834d96cebf 100644
>--- a/drivers/staging/qlge/qlge_devlink.c
>+++ b/drivers/staging/qlge/qlge_devlink.c
>@@ -150,7 +150,6 @@ static const struct devlink_health_reporter_ops qlge_reporter_ops = {
>
> void qlge_health_create_reporters(struct qlge_adapter *priv)
> {
>- struct devlink_health_reporter *reporter;
> struct devlink *devlink;
>
> devlink = priv_to_devlink(priv);
>@@ -160,5 +159,5 @@ void qlge_health_create_reporters(struct qlge_adapter *priv)
> if (IS_ERR(priv->reporter))
> netdev_warn(priv->ndev,
> "Failed to create reporter, err = %ld\n",
>- PTR_ERR(reporter));
>+ PTR_ERR(priv->reporter));
> }
>--
>2.29.2
>
Thanks for fixing this issue.
Reviewed-by: Coiby Xu <coiby.xu@gmail.com>
--
Best regards,
Coiby
prev parent reply other threads:[~2021-02-03 13:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 13:38 [PATCH][next] staging: qlge: fix read of an uninitialized pointer Colin King
2021-02-03 13:50 ` Coiby Xu [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=20210203135009.4boh3fhpaydysxej@Rk \
--to=coiby.xu@gmail.com \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=colin.king@canonical.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).