In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Introduce by commit 0ae99b5fede6f3a8d252d50bb4aba29544295219 (bcm63xx_enet: split DMA channel register accesses)
Unified · Split
| @@ -2862,8 +2862,8 @@ static int bcm_enet_shared_probe(struct platform_device *pdev) · 2861 unmodified lines | ||
| 2862 | 2862 | for (i = 0; i < 3; i++) { |
| 2863 | 2863 | res = platform_get_resource(pdev, IORESOURCE_MEM, i); |
| 2864 | 2864 | p[i] = devm_ioremap_resource(&pdev->dev, res); |
| 2865 | − if (!p[i]) | |
| 2866 | − return -ENOMEM; | |
| 2865 | + if (IS_ERR(p[i])) | |
| 2866 | + return PTR_ERR(p[i]); | |
| 2867 | 2867 | } |
| 2868 | 2868 | |
| 2869 | 2869 | memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base)); |