netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] farsync: add module_put to error path in fst_open()
@ 2011-06-17 16:25 Pavel Shved
  2011-06-17 16:25 ` [PATCH] gigaset: call module_put before restart of if_open() Pavel Shved
  2011-06-17 19:28 ` [PATCH] farsync: add module_put to error path in fst_open() David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Pavel Shved @ 2011-06-17 16:25 UTC (permalink / raw)
  To: Kevin Curtis; +Cc: Pavel Shved, netdev, linux-kernel, ldv-project

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@ispras.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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-17 19:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-17 16:25 [PATCH] farsync: add module_put to error path in fst_open() Pavel Shved
2011-06-17 16:25 ` [PATCH] gigaset: call module_put before restart of if_open() Pavel Shved
2011-06-17 19:28   ` David Miller
2011-06-17 19:28 ` [PATCH] farsync: add module_put to error path in fst_open() David Miller

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).