Commit d0fd64c1 authored by Pavel Shved's avatar Pavel Shved Committed by David S. Miller

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: default avatarPavel Shved <shved@ispras.ru>
Signed-off-by: default avatarDavid S. Miller <davem@conan.davemloft.net>
parent 1eddcead
...@@ -2203,9 +2203,11 @@ fst_open(struct net_device *dev) ...@@ -2203,9 +2203,11 @@ fst_open(struct net_device *dev)
if (port->mode != FST_RAW) { if (port->mode != FST_RAW) {
err = hdlc_open(dev); err = hdlc_open(dev);
if (err) if (err) {
module_put(THIS_MODULE);
return err; return err;
} }
}
fst_openport(port); fst_openport(port);
netif_wake_queue(dev); netif_wake_queue(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment