kernel/drivers/misc/ocxl/file.c
.. .. @@ -543,8 +543,11 @@ 543 543 goto err_put; 544 544 545 545 rc = device_register(&info->dev); 546 - if (rc)547 - goto err_put;546 + if (rc) {547 + free_minor(info);548 + put_device(&info->dev);549 + return rc;550 + }548 551 549 552 rc = ocxl_sysfs_register_afu(info); 550 553 if (rc)