Skip to content

Commit 7943020

Browse files
author
Fox Snowpatch
committed
1 parent 182544a commit 7943020

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/macintosh/adb.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,8 @@ adb_dummy_probe(struct platform_device *dev)
883883
static void __init
884884
adbdev_init(void)
885885
{
886+
int err;
887+
886888
if (register_chrdev(ADB_MAJOR, "adb", &adb_fops)) {
887889
pr_err("adb: unable to get major %d\n", ADB_MAJOR);
888890
return;
@@ -893,6 +895,9 @@ adbdev_init(void)
893895

894896
device_create(&adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
895897

896-
platform_device_register(&adb_pfdev);
898+
err = platform_device_register(&adb_pfdev);
899+
if (err)
900+
platform_device_put(&adb_pfdev);
901+
897902
platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
898903
}

0 commit comments

Comments
 (0)