提交 be967f7d 编写于 作者: C Christophe JAILLET 提交者: Richard Weinberger

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: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NRichard Weinberger <richard@nod.at>
上级 9f3199bc
...@@ -723,7 +723,7 @@ static int vector_config(char *str, char **error_out) ...@@ -723,7 +723,7 @@ static int vector_config(char *str, char **error_out)
*/ */
params = kstrdup(params, GFP_KERNEL); params = kstrdup(params, GFP_KERNEL);
if (str == NULL) { if (params == NULL) {
*error_out = "vector_config failed to strdup string"; *error_out = "vector_config failed to strdup string";
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册