From: Andrew Lunn <andrew@lunn.ch>
To: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
michal.simek@xilinx.com, netdev@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, git@xilinx.com,
Shravya Kumbham <shravya.kumbham@xilinx.com>
Subject: Re: [PATCH 2/2] net: emaclite: Add error handling for of_address_to_resource()
Date: Fri, 29 Apr 2022 03:17:36 +0200 [thread overview]
Message-ID: <Yms8sJzJe6Cl2x7J@lunn.ch> (raw)
In-Reply-To: <1651163278-12701-3-git-send-email-radhey.shyam.pandey@xilinx.com>
On Thu, Apr 28, 2022 at 09:57:58PM +0530, Radhey Shyam Pandey wrote:
> From: Shravya Kumbham <shravya.kumbham@xilinx.com>
>
> check the return value of of_address_to_resource() and also add
> missing of_node_put() for np and npp nodes.
>
> Addresses-Coverity: Event check_return value.
> Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com>
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> ---
> drivers/net/ethernet/xilinx/xilinx_emaclite.c | 15 ++++++++++++---
> 1 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> index f9cf86e..c281423 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> @@ -803,7 +803,7 @@ static int xemaclite_mdio_write(struct mii_bus *bus, int phy_id, int reg,
> static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
> {
> struct mii_bus *bus;
> - int rc;
> + int rc, ret;
> struct resource res;
> struct device_node *np = of_get_parent(lp->phy_node);
> struct device_node *npp;
Reverse Chritmas tree is messed up here, but you could make it a bet
less messed up by moving rc, ret further down.
Andrew
next prev parent reply other threads:[~2022-04-29 1:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 16:27 [PATCH 0/2] emaclite: improve error handling and minor cleanup Radhey Shyam Pandey
2022-04-28 16:27 ` [PATCH 1/2] net: emaclite: Don't advertise 1000BASE-T and do auto negotiation Radhey Shyam Pandey
2022-04-29 1:08 ` Andrew Lunn
2022-04-28 16:27 ` [PATCH 2/2] net: emaclite: Add error handling for of_address_to_resource() Radhey Shyam Pandey
2022-04-29 1:17 ` Andrew Lunn [this message]
2022-04-29 4:52 ` Radhey Shyam Pandey
2022-04-29 1:07 ` [PATCH 0/2] emaclite: improve error handling and minor cleanup Andrew Lunn
2022-04-29 4:44 ` Radhey Shyam Pandey
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=Yms8sJzJe6Cl2x7J@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=git@xilinx.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=radhey.shyam.pandey@xilinx.com \
--cc=shravya.kumbham@xilinx.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).