[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180131081156.19607-11-leon@kernel.org>
Date: Wed, 31 Jan 2018 10:11:56 +0200
From: Leon Romanovsky <leon@...nel.org>
To: David Ahern <dsahern@...il.com>
Cc: RDMA mailing list <linux-rdma@...r.kernel.org>,
Steve Wise <swise@...ngridcomputing.com>,
Leon Romanovsky <leon@...nel.org>,
netdev <netdev@...r.kernel.org>,
Stephen Hemminger <stephen@...workplumber.org>,
Leon Romanovsky <leonro@...lanox.com>
Subject: [PATCH iproute2-next 10/10] rdma: Check return value of strdup call
From: Leon Romanovsky <leonro@...lanox.com>
Fixes: 74bd75c2b68d ("rdma: Add basic infrastructure for RDMA tool")
Signed-off-by: Leon Romanovsky <leonro@...lanox.com>
---
rdma/utils.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/rdma/utils.c b/rdma/utils.c
index 059aa788..f9460162 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -98,6 +98,10 @@ static struct dev_map *dev_map_alloc(const char *dev_name)
if (!dev_map)
return NULL;
dev_map->dev_name = strdup(dev_name);
+ if (!dev_map->dev_name) {
+ free(dev_map);
+ return NULL;
+ }
return dev_map;
}
--
2.16.1
Powered by blists - more mailing lists