net: cpsw: check for cpts pointer after its allocation
authorSebastian Siewior <bigeasy@linutronix.de>
Mon, 17 Jun 2013 17:31:52 +0000 (19:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jun 2013 23:26:07 +0000 (16:26 -0700)
after priv->cpts got allocated then this pointer should check to determine
if the allocation succeeded or not.

Cc: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c

index 21a5b291b4b39d0ae65dcd8766c9e51a25665dee..2fd69db3c09faa5263f64e5881100e7e4eb52bf4 100644 (file)
@@ -1679,7 +1679,7 @@ static int cpsw_probe(struct platform_device *pdev)
        priv->rx_packet_max = max(rx_packet_max, 128);
        priv->cpts = devm_kzalloc(&pdev->dev, sizeof(struct cpts), GFP_KERNEL);
        priv->irq_enabled = true;
-       if (!ndev) {
+       if (!priv->cpts) {
                pr_err("error allocating cpts\n");
                goto clean_ndev_ret;
        }