From: Leon Romanovsky <leonro@xxxxxxxxxxxx> Fixes: 74bd75c2b68d ("rdma: Add basic infrastructure for RDMA tool") Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- 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.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html