From: Dan Carpenter <dan.carpenter@oracle.com>
To: Colin King <colin.king@canonical.com>
Cc: Vladimir Oltean <olteanv@gmail.com>, Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] net: dsa: sja1105: Fix assigned yet unused return code rc
Date: Thu, 10 Jun 2021 09:23:58 +0300 [thread overview]
Message-ID: <20210610062358.GH1955@kadam> (raw)
In-Reply-To: <20210609174353.298731-1-colin.king@canonical.com>
On Wed, Jun 09, 2021 at 06:43:53PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The return code variable rc is being set to return error values in two
> places in sja1105_mdiobus_base_tx_register and yet it is not being
> returned, the function always returns 0 instead. Fix this by replacing
> the return 0 with the return code rc.
>
> Addresses-Coverity: ("Unused value")
> Fixes: 5a8f09748ee7 ("net: dsa: sja1105: register the MDIO buses for 100base-T1 and 100base-TX")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/net/dsa/sja1105/sja1105_mdio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/sja1105/sja1105_mdio.c b/drivers/net/dsa/sja1105/sja1105_mdio.c
> index 8dfd06318b23..08517c70cb48 100644
> --- a/drivers/net/dsa/sja1105/sja1105_mdio.c
> +++ b/drivers/net/dsa/sja1105/sja1105_mdio.c
> @@ -171,7 +171,7 @@ static int sja1105_mdiobus_base_tx_register(struct sja1105_private *priv,
> out_put_np:
> of_node_put(np);
>
> - return 0;
> + return rc;
Should this function really return success if of_device_is_available()?
regards,
dan carpenter
next prev parent reply other threads:[~2021-06-10 6:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 17:43 [PATCH][next] net: dsa: sja1105: Fix assigned yet unused return code rc Colin King
2021-06-09 18:00 ` Vladimir Oltean
2021-06-09 22:50 ` patchwork-bot+netdevbpf
2021-06-10 6:23 ` Dan Carpenter [this message]
2021-06-10 17:51 ` Vladimir Oltean
2021-06-10 18:19 ` Dan Carpenter
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=20210610062358.GH1955@kadam \
--to=dan.carpenter@oracle.com \
--cc=andrew@lunn.ch \
--cc=colin.king@canonical.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@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;
as well as URLs for NNTP newsgroup(s).