All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] um: vector: Fix a memory allocation check
@ 2018-01-27 10:53 ` Christophe JAILLET
  0 siblings, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2018-01-27 10:53 UTC (permalink / raw)
  To: kernel-janitors

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>
---
 arch/um/drivers/vector_kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index d1d53015d572..3c1e6ad91016 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;
 	}
-- 
2.14.1


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [uml-devel] [PATCH 1/2] um: vector: Fix a memory allocation check
@ 2018-01-27 10:53 ` Christophe JAILLET
  0 siblings, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2018-01-27 10:53 UTC (permalink / raw)
  To: jdike, richard, anton.ivanov, user-mode-linux-user
  Cc: Christophe JAILLET, kernel-janitors, user-mode-linux-devel

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>
---
 arch/um/drivers/vector_kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index d1d53015d572..3c1e6ad91016 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;
 	}
-- 
2.14.1


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [uml-devel] [PATCH 1/2] um: vector: Fix a memory allocation check
  2018-01-27 10:53 ` [uml-devel] " Christophe JAILLET
  (?)
@ 2018-01-27 11:41 ` Anton Ivanov
  -1 siblings, 0 replies; 3+ messages in thread
From: Anton Ivanov @ 2018-01-27 11:41 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Richard Weinberger

Thanks, looks correct, +1

Richard, can you add it to the next pull.

Thanks in advance,

A.

On 27/01/18 10:53, Christophe JAILLET wrote:
> 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>
> ---
>  arch/um/drivers/vector_kern.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
> index d1d53015d572..3c1e6ad91016 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;
>  	}



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-27 11:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-27 10:53 [PATCH 1/2] um: vector: Fix a memory allocation check Christophe JAILLET
2018-01-27 10:53 ` [uml-devel] " Christophe JAILLET
2018-01-27 11:41 ` Anton Ivanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.