[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210920132537.65-1-caihuoqing@baidu.com>
Date: Mon, 20 Sep 2021 21:25:37 +0800
From: Cai Huoqing <caihuoqing@...du.com>
To: <davem@...emloft.net>, <kuba@...nel.org>,
<dan.carpenter@...cle.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Cai Huoqing <caihuoqing@...du.com>
Subject: [PATCH] net: arc_emac: Fix the error-dereferencing freed memory 'bus'
Don't print 'bus->name' in the error infoļ¼because 'bus'
has already been freed.
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Cai Huoqing <caihuoqing@...du.com>
---
drivers/net/ethernet/arc/emac_mdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/arc/emac_mdio.c b/drivers/net/ethernet/arc/emac_mdio.c
index 9acf589b1178..2c08855a826c 100644
--- a/drivers/net/ethernet/arc/emac_mdio.c
+++ b/drivers/net/ethernet/arc/emac_mdio.c
@@ -167,7 +167,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
if (error) {
mdiobus_free(bus);
return dev_err_probe(priv->dev, error,
- "cannot register MDIO bus %s\n", bus->name);
+ "Failed to register MDIO bus\n");
}
return 0;
--
2.25.1
Powered by blists - more mailing lists