]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
um: vector: Fix a memory allocation check
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 27 Jan 2018 10:53:57 +0000 (11:53 +0100)
committerRichard Weinberger <richard@nod.at>
Mon, 19 Feb 2018 18:38:51 +0000 (19:38 +0100)
Checking the result of the previous 'kstrdup()' call is expected here, so
we should test 'params' and not 'str' (which is known to be non-NULL at
this point)

Fixes: ad1f62ab2bd4 ("High Performance UML Vector Network Driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/vector_kern.c

index bb83a2d22ac22a25b0c1718d5d20aa32734a40f8..063c76b3a21527935d5ce0ca9a1da74cb5e71b61 100644 (file)
@@ -723,7 +723,7 @@ static int vector_config(char *str, char **error_out)
         */
 
        params = kstrdup(params, GFP_KERNEL);
-       if (str == NULL) {
+       if (params == NULL) {
                *error_out = "vector_config failed to strdup string";
                return -ENOMEM;
        }