Skip to content

Commit

Permalink
farsync: add module_put to error path in fst_open()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Shved authored and David S. Miller committed Jun 17, 2011
1 parent 1eddcea commit d0fd64c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/wan/farsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d0fd64c

Please sign in to comment.