mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-26 12:34:41 +08:00
powerpc/vio: Use put_device() on device_register failure
The kernel doc for device_register (and device_initialize) very clearly state to call put_device not kfree after calling, even on error. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
ffa56e555a
commit
edea8f6f48
@ -1254,8 +1254,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
|
||||
if (device_register(&viodev->dev)) {
|
||||
printk(KERN_ERR "%s: failed to register device %s\n",
|
||||
__func__, dev_name(&viodev->dev));
|
||||
/* XXX free TCE table */
|
||||
kfree(viodev);
|
||||
put_device(&viodev->dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user