diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2013-04-04 13:58:48 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-05 21:33:17 (GMT) |
commit | f5b31e15acd1ab2fd9b9022c29a66f4625fa5658 (patch) | |
tree | 09401f9dd4335b7f9c572a02fa67717653d77a93 /drivers/staging/comedi/drivers.c | |
parent | 3346b798f202bf2f5b5272870ecdb75acec2e752 (diff) | |
download | linux-fsl-qoriq-f5b31e15acd1ab2fd9b9022c29a66f4625fa5658.tar.xz |
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>
Diffstat (limited to 'drivers/staging/comedi/drivers.c')
-rw-r--r-- | drivers/staging/comedi/drivers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 29c8f50..5a506a5 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c @@ -452,7 +452,7 @@ int comedi_auto_config(struct device *hardware_device, mutex_unlock(&comedi_dev->mutex); if (ret < 0) - comedi_free_board_minor(minor); + comedi_release_hardware_device(hardware_device); return ret; } EXPORT_SYMBOL_GPL(comedi_auto_config); |