kmod: Release sub_info on cred allocation failure.
[sfrench/cifs-2.6.git] / kernel / kmod.c
index b750675251e5160ea005e9c384e4c07619731f7d..7e95bedb2bfc19bc1d10eaed1337cd02c1ffdb1c 100644 (file)
@@ -370,8 +370,10 @@ struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
        sub_info->argv = argv;
        sub_info->envp = envp;
        sub_info->cred = prepare_usermodehelper_creds();
-       if (!sub_info->cred)
+       if (!sub_info->cred) {
+               kfree(sub_info);
                return NULL;
+       }
 
   out:
        return sub_info;