Details

[Home]

Issue of the Implementation # L0035

Brief

drivers/net/wan/farsync.c: module_get() without module_put() on an error path in fst_open()

Detailed Description

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.

Possible solutions

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

Component

linux-kernel 2.6.39

References

https://lkml.org/lkml/2011/6/17/266

Accepted

https://lkml.org/lkml/2011/6/17/320 commit d0fd64c

Status

Fixed in kernel 3.0-rc4

[Home]