[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1308327913-23220-1-git-send-email-shved@ispras.ru>
Date: Fri, 17 Jun 2011 20:25:10 +0400
From: Pavel Shved <shved@...ras.ru>
To: Kevin Curtis <kevin.curtis@...site.co.uk>
Cc: Pavel Shved <shved@...ras.ru>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, ldv-project@...ras.ru
Subject: [PATCH] farsync: add module_put to error path in fst_open()
The fst_open() function, after a successful try_module_get() may return
an error code if hdlc_open() returns it. However, it does not put the
module on this error path.
This patch adds the necessary module_put() call.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Pavel Shved <shved@...ras.ru>
---
drivers/net/wan/farsync.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index e050bd6..777d1a4 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2203,8 +2203,10 @@ fst_open(struct net_device *dev)
if (port->mode != FST_RAW) {
err = hdlc_open(dev);
- if (err)
+ if (err) {
+ module_put(THIS_MODULE);
return err;
+ }
}
fst_openport(port);
--
1.7.0.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists