Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00ad691a authored by Arvind Yadav's avatar Arvind Yadav Committed by David S. Miller
Browse files

sparc: vio: use put_device() instead of kfree()



Never directly free @dev after calling device_register(), even
if it returned an error. Always use put_device() to give up the
reference initialized.

Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d3c68d0b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
	if (err) {
		printk(KERN_ERR "VIO: Could not register device %s, err=%d\n",
		       dev_name(&vdev->dev), err);
		kfree(vdev);
		put_device(&vdev->dev);
		return NULL;
	}
	if (vdev->dp)