aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/qlge
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-02-03 13:38:34 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-04 17:14:26 +0100
commit0732ce21329d598ffa8ddac02237ad9b3a7fa34c (patch)
treed72835cd380d63baeb6dbd8a3a04cbe9cc72a37f /drivers/staging/qlge
parentstaging: most: sound: use non-safe list iteration (diff)
downloadlinux-dev-0732ce21329d598ffa8ddac02237ad9b3a7fa34c.tar.xz
linux-dev-0732ce21329d598ffa8ddac02237ad9b3a7fa34c.zip
staging: qlge: fix read of an uninitialized pointer
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. Fixes: 1053c27804df ("staging: qlge: coredump via devlink health reporter") Reviewed-by: Coiby Xu <coiby.xu@gmail.com> Signed-off-by: Colin Ian King <colin.king@canonical.com> Addresses-Coverity: ("Uninitialized pointer read") Link: https://lore.kernel.org/r/20210203133834.22388-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/qlge')
-rw-r--r--drivers/staging/qlge/qlge_devlink.c3
1 files changed, 1 insertions, 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));
}