Message ID | 0f103384-376c-41f0-a35c-8ad98327d6cb@web.de (mailing list archive) |
---|---|
State | New |
Delegated to: | Chanwoo Choi |
Headers | show |
Series | PM / devfreq: event: Call of_node_put() only once in devfreq_event_get_edev_by_phandle() | expand |
diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c index 3ebac2496679..70219099c604 100644 --- a/drivers/devfreq/devfreq-event.c +++ b/drivers/devfreq/devfreq-event.c @@ -244,13 +244,9 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev, edev = NULL; out: mutex_unlock(&devfreq_event_list_lock); - - if (!edev) { - of_node_put(node); - return ERR_PTR(-ENODEV); - } - of_node_put(node); + if (!edev) + return ERR_PTR(-ENODEV); return edev; }