Skip to content

Commit

Permalink
vme: add missing put_device() after device_register() fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Emilio G. Cota authored and Greg Kroah-Hartman committed Feb 14, 2013
1 parent 4026227 commit def1820
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/vme/vme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ static int __vme_register_driver_bus(struct vme_driver *drv,
return 0;

err_reg:
put_device(&vdev->dev);
kfree(vdev);
err_devalloc:
list_for_each_entry_safe(vdev, tmp, &drv->devices, drv_list) {
Expand Down

0 comments on commit def1820

Please sign in to comment.