]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
param: fix NULL comparison on oom
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 29 Oct 2009 14:56:17 +0000 (08:56 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:22:18 +0000 (16:22 -0800)
commit d553ad864e3b3dde3f1038d491e207021b2d6293 upstream.

kp->arg is always true: it's the contents of that pointer we care about.

Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/params.c

index 276fd63bc780d3c692cabfdb39689e864d28bd53..46c2fbbfb85fda70b0b40d03f3a8dc1c8db2112e 100644 (file)
@@ -221,7 +221,7 @@ int param_set_charp(const char *val, struct kernel_param *kp)
         * don't need to; this mangled commandline is preserved. */
        if (slab_is_available()) {
                *(char **)kp->arg = kstrdup(val, GFP_KERNEL);
-               if (!kp->arg)
+               if (!*(char **)kp->arg)
                        return -ENOMEM;
        } else
                *(const char **)kp->arg = val;