]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: put module _after_ detach
authorIan Abbott <abbotti@mev.co.uk>
Thu, 4 Apr 2013 13:58:57 +0000 (14:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 21:33:18 +0000 (14:33 -0700)
commitcff8146fa8ce9e39ea27227f3f479691aedc9b8e
tree04a6965c7bed192adef204499e4661990b4bc770
parent4ae43cce64893328ed771dd7cc71bacc2aa38ed5
staging: comedi: put module _after_ detach

On failure of the call to the low-level comedi device driver's
`->attach()` handler from `__comedi_device_attach()`, reverse the
current ordering of the calls to `module_put()` and
`comedi_device_detach()` because `__comedi_device_detach()` will call
code in the module being put.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers.c