Message ID | 1532934423-179537-1-git-send-email-weiyongjun1@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Eduardo Valentin |
Headers | show |
Series | [-next,v3] thermal: armada: fix copy-paste error in armada_thermal_probe() | expand |
On 30/07/2018 09:07, Wei Yongjun wrote: > 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> > --- > v2 - > v3: fix the description > --- Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Hi Wei, Daniel Lezcano <daniel.lezcano@linaro.org> wrote on Mon, 30 Jul 2018 09:29:32 +0200: > On 30/07/2018 09:07, Wei Yongjun wrote: > > 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> > > --- > > v2 - > v3: fix the description > > --- > > > Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> > > Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Thanks, Miquèl
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index 8de4ba5..a269482 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -610,7 +610,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;
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> --- v2 - > v3: fix the description --- drivers/thermal/armada_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)