From: Sebastian Siewior Date: Mon, 17 Jun 2013 17:31:52 +0000 (+0200) Subject: net: cpsw: check for cpts pointer after its allocation X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=ab8e99d276d4b72d1532bda4423b14c9e2ce053c;p=deliverable%2Flinux.git net: cpsw: check for cpts pointer after its allocation after priv->cpts got allocated then this pointer should check to determine if the allocation succeeded or not. Cc: Mugunthan V N Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 21a5b291b4b3..2fd69db3c09f 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -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; }