Commit ab8e99d2 authored by Sebastian Siewior's avatar Sebastian Siewior Committed by David S. Miller

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 <mugunthanvnm@ti.com>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c5b248dd
...@@ -1679,7 +1679,7 @@ static int cpsw_probe(struct platform_device *pdev) ...@@ -1679,7 +1679,7 @@ static int cpsw_probe(struct platform_device *pdev)
priv->rx_packet_max = max(rx_packet_max, 128); priv->rx_packet_max = max(rx_packet_max, 128);
priv->cpts = devm_kzalloc(&pdev->dev, sizeof(struct cpts), GFP_KERNEL); priv->cpts = devm_kzalloc(&pdev->dev, sizeof(struct cpts), GFP_KERNEL);
priv->irq_enabled = true; priv->irq_enabled = true;
if (!ndev) { if (!priv->cpts) {
pr_err("error allocating cpts\n"); pr_err("error allocating cpts\n");
goto clean_ndev_ret; goto clean_ndev_ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment