]> git.baikalelectronics.ru Git - kernel.git/commit
gigaset: call module_put before restart of if_open()
authorPavel Shved <shved@ispras.ru>
Fri, 17 Jun 2011 06:25:11 +0000 (06:25 +0000)
committerDavid S. Miller <davem@conan.davemloft.net>
Fri, 17 Jun 2011 19:27:32 +0000 (15:27 -0400)
commit31695bcaad2ee346623f23a6fcb14a314cbdc006
tree8d87fe2573694a91f8ae46e5bb90d2096c1a45a4
parent8959826b663946ba3c5d1bf820e95aae1421ca24
gigaset: call module_put before restart of if_open()

if_open() calls try_module_get(), and after an attempt to lock a mutex
the if_open() function may return -ERESTARTSYS without
putting the module.  Then, when if_open() is executed again,
try_module_get() is called making the reference counter of THIS_MODULE
greater than one at successful exit from if_open().  The if_close()
function puts the module only once, and as a result it can't be
unloaded.

This patch adds module_put call before the return from if_open().

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>
drivers/isdn/gigaset/interface.c