The return value from devm_kzalloc() is not checked correctly. The
test is done against a wrong variable. Fix it.
Fixes: e72f03ef2543 ("thermal: armada: use the resource managed registration helper alternative")
Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Daniel Lezcano <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Signed-off-by: Eduardo Valentin <[email protected]>
return -ENOMEM;
drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
- if (!priv)
+ if (!drvdata)
return -ENOMEM;
priv->dev = &pdev->dev;