linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwspinlock/core: Fix unbalanced module_get on error path
@ 2012-12-12 20:24 Ido Yariv
  0 siblings, 0 replies; only message in thread
From: Ido Yariv @ 2012-12-12 20:24 UTC (permalink / raw)
  To: Ohad Ben-Cohen, linux-kernel, linux-arm-kernel, linux-omap; +Cc: Ido Yariv

In case pm_runtime_get_sync() fails, __hwspin_lock_request will exit
without calling module_put. As a result, the module could never be
removed. Fix this.

Signed-off-by: Ido Yariv <ido@wizery.com>
---
 drivers/hwspinlock/hwspinlock_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index db713c0..085e28e 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -415,6 +415,7 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock)
 	/* notify PM core that power is now needed */
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
+		module_put(dev->driver->owner);
 		dev_err(dev, "%s: can't power on device\n", __func__);
 		return ret;
 	}
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-12 20:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 20:24 [PATCH] hwspinlock/core: Fix unbalanced module_get on error path Ido Yariv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).