WSL2-Linux-Kernel/drivers/net/ethernet/xilinx
Zhang Changzhong cc6596fc72 net: ll_temac: Fix potential NULL dereference in temac_probe()
platform_get_resource() may fail and in this case a NULL dereference
will occur.

Fix it to use devm_platform_ioremap_resource() instead of calling
platform_get_resource() and devm_ioremap().

This is detected by Coccinelle semantic patch.

@@
expression pdev, res, n, t, e, e1, e2;
@@

res = \(platform_get_resource\|platform_get_resource_byname\)(pdev, t, n);
+ if (!res)
+   return -EINVAL;
... when != res == NULL
e = devm_ioremap(e1, res->start, e2);

Fixes: 8425c41d1e ("net: ll_temac: Extend support to non-device-tree platforms")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: Esben Haabendal <esben@geanix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-12-08 16:15:46 -08:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile
ll_temac.h net: ll_temac: Add ethtool support for coalesce parameters 2020-02-29 21:30:43 -08:00
ll_temac_main.c net: ll_temac: Fix potential NULL dereference in temac_probe() 2020-12-08 16:15:46 -08:00
ll_temac_mdio.c net: ll_temac: Prepare indirect register access for multicast support 2019-05-23 09:33:57 -07:00
xilinx_axienet.h net: axienet: fix spelling mistake in comment "Exteneded" -> "extended" 2020-06-15 13:02:03 -07:00
xilinx_axienet_main.c net: xilinx: remove redundant null check before clk_disable_unprepare() 2020-09-07 13:34:14 -07:00
xilinx_axienet_mdio.c net: axienet: Fix MDIO bus parent node detection 2019-06-06 16:24:30 -07:00
xilinx_emaclite.c netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00