thermal: armada: fix copy-paste error in armada_thermal_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 30 Jul 2018 07:07:03 +0000 (07:07 +0000)
committerEduardo Valentin <edubezval@gmail.com>
Wed, 1 Aug 2018 16:56:12 +0000 (09:56 -0700)
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>
drivers/thermal/armada_thermal.c

index 4164a5a4e480731e0a2f5fa5fbc9ea324c2bb40d..2c2f6d93034ec9764f3596d18cd3891d0e3565b6 100644 (file)
@@ -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;