All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ethernet: broadcom/sb1250-mac: remove BUG_ON in sbmac_probe()
@ 2022-04-21 13:51 Yang Yingliang
  2022-04-25 10:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2022-04-21 13:51 UTC (permalink / raw)
  To: linux-kernel, netdev; +Cc: davem, kuba

Replace the BUG_ON() with returning error code to handle
the fault more gracefully.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/ethernet/broadcom/sb1250-mac.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/sb1250-mac.c b/drivers/net/ethernet/broadcom/sb1250-mac.c
index a1a38456c9a3..5d5f10180158 100644
--- a/drivers/net/ethernet/broadcom/sb1250-mac.c
+++ b/drivers/net/ethernet/broadcom/sb1250-mac.c
@@ -2534,7 +2534,12 @@ static int sbmac_probe(struct platform_device *pldev)
 	int err;
 
 	res = platform_get_resource(pldev, IORESOURCE_MEM, 0);
-	BUG_ON(!res);
+	if (!res) {
+		printk(KERN_ERR "%s: failed to get resource\n",
+		       dev_name(&pldev->dev));
+		err = -EINVAL;
+		goto out_out;
+	}
 	sbm_base = ioremap(res->start, resource_size(res));
 	if (!sbm_base) {
 		printk(KERN_ERR "%s: unable to map device registers\n",
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ethernet: broadcom/sb1250-mac: remove BUG_ON in sbmac_probe()
  2022-04-21 13:51 [PATCH] ethernet: broadcom/sb1250-mac: remove BUG_ON in sbmac_probe() Yang Yingliang
@ 2022-04-25 10:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-25 10:30 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, netdev, davem, kuba

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 21 Apr 2022 21:51:48 +0800 you wrote:
> Replace the BUG_ON() with returning error code to handle
> the fault more gracefully.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/net/ethernet/broadcom/sb1250-mac.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Here is the summary with links:
  - ethernet: broadcom/sb1250-mac: remove BUG_ON in sbmac_probe()
    https://git.kernel.org/netdev/net-next/c/60d78e9fce88

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-25 10:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-21 13:51 [PATCH] ethernet: broadcom/sb1250-mac: remove BUG_ON in sbmac_probe() Yang Yingliang
2022-04-25 10:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.