Commit 60d78e9f authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller

ethernet: broadcom/sb1250-mac: remove BUG_ON in sbmac_probe()

Replace the BUG_ON() with returning error code to handle
the fault more gracefully.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 985e254c
...@@ -2534,7 +2534,12 @@ static int sbmac_probe(struct platform_device *pldev) ...@@ -2534,7 +2534,12 @@ static int sbmac_probe(struct platform_device *pldev)
int err; int err;
res = platform_get_resource(pldev, IORESOURCE_MEM, 0); 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)); sbm_base = ioremap(res->start, resource_size(res));
if (!sbm_base) { if (!sbm_base) {
printk(KERN_ERR "%s: unable to map device registers\n", printk(KERN_ERR "%s: unable to map device registers\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment