PM / devfreq: use put_device() instead of kfree()
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Tue, 29 Jan 2019 05:49:02 +0000 (14:49 +0900)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 Feb 2019 05:58:23 +0000 (14:58 +0900)
commit8a396a8c57b0668115489c34c4c2f6abb0ff1bf1
treec9deba1c32c28e212e978f3e7d93030945b6a75b
parent27e867c69e2f0a3c92738c4a8ec56fc4f2f9c802
PM / devfreq: use put_device() instead of kfree()

Never directly free @dev after calling device_register() or
device_unregister(), even if device_register() returned an error.
Always use put_device() to give up the reference initialized.

Change-Id: I65b83e63daf44ff784753b2372890f07c6515a46
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
[cw00.choi: Backported from mainline kernel]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/devfreq.c