mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
sparc: vio: use put_device() instead of kfree()
[ Upstream commit 00ad691ab1
]
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: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c98b38c5ed
commit
ea5ffcd467
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue