DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/nfp: fix null pointer check
@ 2017-11-08 14:36 Alejandro Lucero
  2017-11-10  9:38 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Lucero @ 2017-11-08 14:36 UTC (permalink / raw)
  To: dev; +Cc: stable

First, the received pointer was not checked before. Then the pointer
from malloc was not the one used in the existing check.

Fixes: ad60bca34899 ("net/nfp: read PF port MAC addr using NSP")
Coverity: 195027

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_nspu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_nspu.c b/drivers/net/nfp/nfp_nspu.c
index 39d14e6..0b415fc 100644
--- a/drivers/net/nfp/nfp_nspu.c
+++ b/drivers/net/nfp/nfp_nspu.c
@@ -618,10 +618,14 @@
 {
 	int ret;
 
+	if (!table)
+		return -EINVAL;
+
 	RTE_LOG(INFO, PMD, "Reading hw ethernet table...\n");
+
 	/* port 0 allocates the eth table and read it using NSPU */
 	*table = malloc(NSP_ETH_TABLE_SIZE);
-	if (!table)
+	if (!*table)
 		return -ENOMEM;
 
 	ret = nspu_command(desc, NSP_CMD_READ_ETH_TABLE, 1, 0, *table,
-- 
1.9.1

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/nfp: fix null pointer check
  2017-11-08 14:36 [dpdk-dev] [PATCH] net/nfp: fix null pointer check Alejandro Lucero
@ 2017-11-10  9:38 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2017-11-10  9:38 UTC (permalink / raw)
  To: Alejandro Lucero, dev; +Cc: stable

On 11/8/2017 6:36 AM, Alejandro Lucero wrote:
> First, the received pointer was not checked before. Then the pointer
> from malloc was not the one used in the existing check.
> 
> Fixes: ad60bca34899 ("net/nfp: read PF port MAC addr using NSP")
> Coverity: 195027
> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>

Applied to dpdk/master, thanks.

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

end of thread, other threads:[~2017-11-10  9:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 14:36 [dpdk-dev] [PATCH] net/nfp: fix null pointer check Alejandro Lucero
2017-11-10  9:38 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).