vme: add missing put_device() after device_register() fails
put_device() must be called after device_register() fails, since device_register() always initializes the refcount on the device structure. Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
40262275f0
commit
def1820d25
1 changed files with 1 additions and 0 deletions
|
@ -1376,6 +1376,7 @@ static int __vme_register_driver_bus(struct vme_driver *drv,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_reg:
|
err_reg:
|
||||||
|
put_device(&vdev->dev);
|
||||||
kfree(vdev);
|
kfree(vdev);
|
||||||
err_devalloc:
|
err_devalloc:
|
||||||
list_for_each_entry_safe(vdev, tmp, &drv->devices, drv_list) {
|
list_for_each_entry_safe(vdev, tmp, &drv->devices, drv_list) {
|
||||||
|
|
Loading…
Reference in a new issue