diff --git a/lib/test_firmware.c b/lib/test_firmware.c index f978aebe60c5..2e5e18bbfd28 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -895,8 +895,11 @@ static int __init test_firmware_init(void) return -ENOMEM; rc = __test_firmware_config_init(); - if (rc) + if (rc) { + kfree(test_fw_config); + pr_err("could not init firmware test config: %d\n", rc); return rc; + } rc = misc_register(&test_fw_misc_device); if (rc) {