[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171112082739.GA20464@embeddedor.com>
Date: Sun, 12 Nov 2017 02:27:39 -0600
From: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
To: MyungJoo Ham <myungjoo.ham@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
"Gustavo A. R. Silva" <garsilva@...eddedor.com>
Subject: [PATCH] PM / devfreq: Remove unnecessary NULL check before kfree
NULL check before freeing functions like kfree is not needed.
This issue was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
---
drivers/devfreq/devfreq.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 78fb496..21164a9 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -672,8 +672,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
device_unregister(&devfreq->dev);
err_dev:
- if (devfreq)
- kfree(devfreq);
+ kfree(devfreq);
err_out:
return ERR_PTR(err);
}
--
2.7.4
Powered by blists - more mailing lists