Skip to content

Commit 3961448

Browse files
committed
Merge tag 'for-linus-4.16a-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fix from Juergen Gross: "Just one fix for the correct error handling after a failed device_register()" * tag 'for-linus-4.16a-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: xenbus: use put_device() instead of kfree()
2 parents 4178802 + 351b2bc commit 3961448

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/xen/xenbus/xenbus_probe.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,11 @@ int xenbus_probe_node(struct xen_bus_type *bus,
466466

467467
/* Register with generic device framework. */
468468
err = device_register(&xendev->dev);
469-
if (err)
469+
if (err) {
470+
put_device(&xendev->dev);
471+
xendev = NULL;
470472
goto fail;
473+
}
471474

472475
return 0;
473476
fail:

0 commit comments

Comments
 (0)