All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: David Ahern <dsahern@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Steve Wise <swise@opengridcomputing.com>,
	Leon Romanovsky <leonro@mellanox.com>
Subject: [PATCH iproute2-next v2 10/10] rdma: Check return value of strdup call
Date: Wed, 17 Jan 2018 12:02:32 +0200	[thread overview]
Message-ID: <20180117100232.3155-11-leon@kernel.org> (raw)
In-Reply-To: <20180117100232.3155-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Fixes: 74bd75c2b68d ("rdma: Add basic infrastructure for RDMA tool")
Signed-off-by: Leon Romanovsky <leonro@mellanox.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.15.1

      parent reply	other threads:[~2018-01-17 10:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 10:02 [PATCH iproute2-next v2 00/10] RDMA resource tracking Leon Romanovsky
2018-01-17 10:02 ` [PATCH iproute2-next v2 01/10] rdma: Add option to provide "-" sign for the port number Leon Romanovsky
2018-01-17 10:02 ` [PATCH iproute2-next v2 02/10] rdma: Make visible the number of arguments Leon Romanovsky
2018-01-17 10:02 ` [PATCH iproute2-next v2 03/10] rdma: Add filtering infrastructure Leon Romanovsky
2018-01-17 10:02 ` [PATCH iproute2-next v2 04/10] rdma: Set pointer to device name position Leon Romanovsky
2018-01-17 10:02 ` [PATCH iproute2-next v2 05/10] rdma: Allow external usage of compare string routine Leon Romanovsky
     [not found] ` <20180117100232.3155-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-17 10:02   ` [PATCH iproute2-next v2 06/10] rdma: Update kernel header file Leon Romanovsky
2018-01-23 18:33   ` [PATCH iproute2-next v2 00/10] RDMA resource tracking David Ahern
     [not found]     ` <f0ac1406-6ef4-cdcb-5a81-82c52e9d450d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-23 18:47       ` Leon Romanovsky
2018-01-17 10:02 ` [PATCH iproute2-next v2 07/10] rdma: Add resource tracking summary Leon Romanovsky
2018-01-17 10:02 ` [PATCH iproute2-next v2 08/10] rdma: Add QP resource tracking information Leon Romanovsky
2018-01-17 10:02 ` [PATCH iproute2-next v2 09/10] rdma: Document resource tracking Leon Romanovsky
2018-01-17 10:02 ` Leon Romanovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180117100232.3155-11-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=swise@opengridcomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.