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: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>5bit-waveforms
parent
c5b248dd05
commit
ab8e99d276
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue