[dpdk-dev,v2] eal: Fix wrong error checking while parsing device arguments

Message ID 1466044391-3210-1-git-send-email-mukawa@igel.co.jp (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Tetsuya Mukawa June 16, 2016, 2:33 a.m. UTC
  This patch fixes wrong error checking of rte_eal_parse_devargs_str().
Currently, a return value of strdup() is wrongly checked.

Fixes: 0fe11ec592b2 ("eal: add vdev init and uninit")
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
 lib/librte_eal/common/eal_common_devargs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Marchand June 17, 2016, 12:10 p.m. UTC | #1
On Thu, Jun 16, 2016 at 4:33 AM, Tetsuya Mukawa <mukawa@igel.co.jp> wrote:
> This patch fixes wrong error checking of rte_eal_parse_devargs_str().
> Currently, a return value of strdup() is wrongly checked.
>
> Fixes: 0fe11ec592b2 ("eal: add vdev init and uninit")
> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>

Forgot to pass this patch through scripts/check-git-log.sh script :

Wrong headline uppercase:
    eal: Fix wrong error checking while parsing device arguments


With this fixed, you can add my ack.
  
Thomas Monjalon June 20, 2016, 8:49 a.m. UTC | #2
2016-06-17 14:10, David Marchand:
> On Thu, Jun 16, 2016 at 4:33 AM, Tetsuya Mukawa <mukawa@igel.co.jp> wrote:
> > This patch fixes wrong error checking of rte_eal_parse_devargs_str().
> > Currently, a return value of strdup() is wrongly checked.
> >
> > Fixes: 0fe11ec592b2 ("eal: add vdev init and uninit")
> > Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
> 
> Forgot to pass this patch through scripts/check-git-log.sh script :
> 
> Wrong headline uppercase:
>     eal: Fix wrong error checking while parsing device arguments
> 
> 
> With this fixed, you can add my ack.

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c
index 2bfe54a..e403717 100644
--- a/lib/librte_eal/common/eal_common_devargs.c
+++ b/lib/librte_eal/common/eal_common_devargs.c
@@ -58,7 +58,7 @@  rte_eal_parse_devargs_str(const char *devargs_str,
 		return -1;
 
 	*drvname = strdup(devargs_str);
-	if (drvname == NULL)
+	if (*drvname == NULL)
 		return -1;
 
 	/* set the first ',' to '\0' to split name and arguments */