Skip to content

Commit def1820

Browse files
cotagregkh
authored andcommitted
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>
1 parent 4026227 commit def1820

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎drivers/vme/vme.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,7 @@ static int __vme_register_driver_bus(struct vme_driver *drv,
13761376
return 0;
13771377

13781378
err_reg:
1379+
put_device(&vdev->dev);
13791380
kfree(vdev);
13801381
err_devalloc:
13811382
list_for_each_entry_safe(vdev, tmp, &drv->devices, drv_list) {

0 commit comments

Comments
 (0)