test_firmware: fix a memory leak bug
[linux-2.6-microblaze.git] / lib / test_firmware.c
index 83ea6c4..6ca97a6 100644 (file)
@@ -886,8 +886,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) {