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

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
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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",