alistair23-linux/drivers/net/ethernet/xilinx
Wen Yang ef86ea982b net: axienet: fix a potential double free in axienet_probe()
There is a possible use-after-free issue in the axienet_probe():

1701:	np = of_parse_phandle(pdev->dev.of_node, "axistream-connected", 0);
1702:   if (np) {
...
1787:		of_node_put(np); ---> released here
1788:		lp->eth_irq = platform_get_irq(pdev, 0);
1789:	} else {
...
1801:	}
1802:	if (IS_ERR(lp->dma_regs)) {
...
1805:		of_node_put(np); ---> double released here
1806:		goto free_netdev;
1807:	}

We solve this problem by removing the unnecessary of_node_put().

Fixes: 28ef9ebdb6 ("net: axienet: make use of axistream-connected attribute optional")
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Cc: Anirudha Sarangi <anirudh@xilinx.com>
Cc: John Linn <John.Linn@xilinx.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Robert Hancock <hancock@sedsystems.ca>
Cc: netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-08 16:28:32 -07:00
..
Kconfig net: axienet: convert to phylink API 2019-06-06 16:24:30 -07:00
ll_temac.h net: ll_temac: Prepare indirect register access for multicast support 2019-05-23 09:33:57 -07:00
ll_temac_main.c net: ll_temac: Fix compile error 2019-05-23 22:27:52 -07:00
ll_temac_mdio.c net: ll_temac: Prepare indirect register access for multicast support 2019-05-23 09:33:57 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xilinx_axienet.h net: axienet: convert to phylink API 2019-06-06 16:24:30 -07:00
xilinx_axienet_main.c net: axienet: fix a potential double free in axienet_probe() 2019-07-08 16:28:32 -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 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00