netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
To: <davem@davemloft.net>, <michal.simek@xilinx.com>,
	<radhey.shyam.pandey@xilinx.com>
Cc: <netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 1/4] net: emaclite: Fix position of lp->mii_bus assignment
Date: Wed, 13 Jun 2018 12:05:16 +0530	[thread overview]
Message-ID: <1528871719-1681-2-git-send-email-radhey.shyam.pandey@xilinx.com> (raw)
In-Reply-To: <1528871719-1681-1-git-send-email-radhey.shyam.pandey@xilinx.com>

To ensure MDIO bus is not double freed in remove() path
assign lp->mii_bus after MDIO bus registration.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/net/ethernet/xilinx/xilinx_emaclite.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 69e31ce..37989ce 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -863,14 +863,14 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
 	bus->write = xemaclite_mdio_write;
 	bus->parent = dev;
 
-	lp->mii_bus = bus;
-
 	rc = of_mdiobus_register(bus, np);
 	if (rc) {
 		dev_err(dev, "Failed to register mdio bus.\n");
 		goto err_register;
 	}
 
+	lp->mii_bus = bus;
+
 	return 0;
 
 err_register:
-- 
1.7.1

  reply	other threads:[~2018-06-13  6:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13  6:35 [PATCH 0/4] emaclite bug fixes and code cleanup Radhey Shyam Pandey
2018-06-13  6:35 ` Radhey Shyam Pandey [this message]
2018-06-13  7:21   ` [PATCH 1/4] net: emaclite: Fix position of lp->mii_bus assignment Andrew Lunn
2018-06-13  6:35 ` [PATCH 2/4] net: emaclite: Fix MDIO bus unregister bug Radhey Shyam Pandey
2018-06-13  7:23   ` Andrew Lunn
2018-06-13  6:35 ` [PATCH 3/4] net: emaclite: Remove unused 'has_mdio' flag Radhey Shyam Pandey
2018-06-13  7:23   ` Andrew Lunn
2018-06-13  6:35 ` [PATCH 4/4] net: emaclite: Remove xemaclite_mdio_setup return check Radhey Shyam Pandey
2018-06-13  7:29   ` Andrew Lunn
2018-06-13 16:02     ` Radhey Shyam Pandey
2018-06-15  0:08 ` [PATCH 0/4] emaclite bug fixes and code cleanup David Miller

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=1528871719-1681-2-git-send-email-radhey.shyam.pandey@xilinx.com \
    --to=radhey.shyam.pandey@xilinx.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.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).