Commit a9487917 authored by Yangtao Li's avatar Yangtao Li Committed by MyungJoo Ham
Browse files

PM / devfreq: fix mem leak in devfreq_add_device()



'devfreq' is malloced in devfreq_add_device() and should be freed in
the error handling cases, otherwise it will cause memory leak.

Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
parent 0d00a239
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -651,7 +651,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
		mutex_unlock(&devfreq->lock);
		err = set_freq_table(devfreq);
		if (err < 0)
			goto err_out;
			goto err_dev;
		mutex_lock(&devfreq->lock);
	}