From: Christophe JAILLET Date: Sat, 27 Jan 2018 10:53:57 +0000 (+0100) Subject: um: vector: Fix a memory allocation check X-Git-Tag: v4.19~1227^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be967f7da50b6d08fbb78a5e4408843a9453ac1b;p=platform%2Fkernel%2Flinux-rpi.git um: vector: Fix a memory allocation check 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 Signed-off-by: Richard Weinberger --- diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index bb83a2d22ac2..063c76b3a215 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -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; }