net: fec: fix NULL pointer dereference in fec_enet_timeout_work
authorHubert Feurstein <h.feurstein@gmail.com>
Wed, 7 Jan 2015 13:48:17 +0000 (14:48 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Jan 2015 04:12:28 +0000 (20:12 -0800)
This patch initialises the fep->netdev pointer. This pointer was not
initialised at all, but is used in fec_enet_timeout_work and in some
error paths.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index 5ebdf8dc8a31300f526fd98912080dc4850937f2..dbcab1cecf68615ee203ceab32d73a3bd5cadfe7 100644 (file)
@@ -3129,6 +3129,7 @@ fec_probe(struct platform_device *pdev)
                pdev->id_entry = of_id->data;
        fep->quirks = pdev->id_entry->driver_data;
 
+       fep->netdev = ndev;
        fep->num_rx_queues = num_rx_qs;
        fep->num_tx_queues = num_tx_qs;