diff mbox series

[-next,v2] thermal: armada: fix copy-paste error in armada_thermal_probe()

Message ID 1532918717-46808-1-git-send-email-weiyongjun1@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Eduardo Valentin
Headers show
Series [-next,v2] thermal: armada: fix copy-paste error in armada_thermal_probe() | expand

Commit Message

Wei Yongjun July 30, 2018, 2:45 a.m. UTC
Fix the retrn value check which testing the wrong variable
in armada_thermal_probe().

Fixes: e72f03ef2543 ("thermal: armada: use the resource managed registration helper alternative")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 - > v2: fix typo of patch subject
---
 drivers/thermal/armada_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Lezcano July 30, 2018, 6:25 a.m. UTC | #1
On 30/07/2018 04:45, Wei Yongjun wrote:
> Fix the retrn value check which testing the wrong variable

s/retrn/return/

"which testing" is not correct.

I would suggest something like:

 "The return value from devm_kzalloc() is not checked correctly. The
test is done against a wrong variable. Fix it."


> in armada_thermal_probe().
> 
> Fixes: e72f03ef2543 ("thermal: armada: use the resource managed registration helper alternative")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> v1 - > v2: fix typo of patch subject
> ---
>  drivers/thermal/armada_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;
>
diff mbox series

Patch

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;