]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: call comedi_release_hardware_device() on error
authorIan Abbott <abbotti@mev.co.uk>
Thu, 4 Apr 2013 13:58:48 +0000 (14:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 21:33:17 +0000 (14:33 -0700)
commit60ba34f21ec138cbf7c5d65b5da4c6d18da53ca4
tree09401f9dd4335b7f9c572a02fa67717653d77a93
parentdf4600c3e8c7d1d60804451e5aec44becb9dc4ac
staging: comedi: call comedi_release_hardware_device() on error

If `comedi_auto_config()` fails after allocating the minor device, call
`comedi_release_hardware_device()` instead of
`comedi_free_board_minor()` to free the minor device.  That's the same
call that `comedi_auto_unconfig()` uses, and is slightly safer as it
checks the minor device number is still tied to the same hardware
device.

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