summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-07-30 09:07:03 +0200
committerEduardo Valentin <edubezval@gmail.com>2018-08-01 18:56:12 +0200
commit84b64de597bcc26549a7cbfe2fa8022bbc142daa (patch)
treec2fb2c3d67b9a8d706df1ec87839baeb1473e373
parentthermal: rcar_thermal: avoid NULL dereference in absence of IRQ resources (diff)
downloadlinux-84b64de597bcc26549a7cbfe2fa8022bbc142daa.tar.xz
linux-84b64de597bcc26549a7cbfe2fa8022bbc142daa.zip
thermal: armada: fix copy-paste error in armada_thermal_probe()
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 <weiyongjun1@huawei.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/armada_thermal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index 4164a5a4e480..2c2f6d93034e 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -611,7 +611,7 @@ static int armada_thermal_probe(struct platform_device *pdev)
return -ENOMEM;
drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
- if (!priv)
+ if (!drvdata)
return -ENOMEM;
priv->dev = &pdev->dev;