test_firmware: fix memory leak in test_firmware_init()
[platform/kernel/linux-starfive.git] / lib / test_firmware.c
index c82b659..1c5a2ad 100644 (file)
@@ -1491,6 +1491,7 @@ static int __init test_firmware_init(void)
 
        rc = misc_register(&test_fw_misc_device);
        if (rc) {
+               __test_firmware_config_free();
                kfree(test_fw_config);
                pr_err("could not register misc device: %d\n", rc);
                return rc;