summaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorPavel Shved <shved@ispras.ru>2011-06-17 08:25:10 +0200
committerDavid S. Miller <davem@conan.davemloft.net>2011-06-17 21:27:32 +0200
commitd0fd64c1de437bdf91c32d4f84a53fa4b2150348 (patch)
tree85ed9777696fae76834a1e546bb1d733a73abc33 /drivers/net/wan
parentnet: rfs: enable RFS before first data packet is received (diff)
downloadlinux-d0fd64c1de437bdf91c32d4f84a53fa4b2150348.tar.xz
linux-d0fd64c1de437bdf91c32d4f84a53fa4b2150348.zip
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@ispras.ru> Signed-off-by: David S. Miller <davem@conan.davemloft.net>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/farsync.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index e050bd65e037..777d1a4e81b2 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);