]> git.proxmox.com Git - mirror_ubuntu-artful-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)
commitdcd7b8bd63cb81c5b973bf86510ca3c80bbbd162
tree04a6965c7bed192adef204499e4661990b4bc770
parentb2a644b435de1d45bd8b5d4e391c894a662eb1f3
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