From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id B19B4A3 for ; Fri, 8 Mar 2019 18:49:27 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 8 Mar 2019 19:49:22 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x28HloBB002625; Fri, 8 Mar 2019 19:49:21 +0200 From: Yongseok Koh To: Tiwei Bie Cc: Maxime Coquelin , dpdk stable Date: Fri, 8 Mar 2019 09:47:33 -0800 Message-Id: <20190308174749.30771-55-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190308174749.30771-1-yskoh@mellanox.com> References: <20190308174749.30771-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'examples/vhost: fix path allocation failure handling' has been queued to LTS release 17.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2019 17:49:28 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objection by 03/13/19. So please shout if anyone has objection. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From dc2d27d6a26975543954d4d91f4364136bc5f64c Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Tue, 15 Jan 2019 15:13:24 +0800 Subject: [PATCH] examples/vhost: fix path allocation failure handling [ upstream commit d79035b7dd6e599589552573b53c138f488dead3 ] Add the missing failure handling for path allocation, as realloc() may fail. Fixes: ad0eef4d2203 ("examples/vhost: support multiple socket files") Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- examples/vhost/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 82660a673..9a1ec0341 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -400,11 +400,19 @@ port_init(uint16_t port) static int us_vhost_parse_socket_path(const char *q_arg) { + char *old; + /* parse number string */ if (strnlen(q_arg, PATH_MAX) == PATH_MAX) return -1; + old = socket_files; socket_files = realloc(socket_files, PATH_MAX * (nb_sockets + 1)); + if (socket_files == NULL) { + free(old); + return -1; + } + snprintf(socket_files + nb_sockets * PATH_MAX, PATH_MAX, "%s", q_arg); nb_sockets++; -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-03-08 09:46:42.924680999 -0800 +++ 0055-examples-vhost-fix-path-allocation-failure-handling.patch 2019-03-08 09:46:40.283442000 -0800 @@ -1,13 +1,14 @@ -From d79035b7dd6e599589552573b53c138f488dead3 Mon Sep 17 00:00:00 2001 +From dc2d27d6a26975543954d4d91f4364136bc5f64c Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Tue, 15 Jan 2019 15:13:24 +0800 Subject: [PATCH] examples/vhost: fix path allocation failure handling +[ upstream commit d79035b7dd6e599589552573b53c138f488dead3 ] + Add the missing failure handling for path allocation, as realloc() may fail. Fixes: ad0eef4d2203 ("examples/vhost: support multiple socket files") -Cc: stable@dpdk.org Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin @@ -16,10 +17,10 @@ 1 file changed, 8 insertions(+) diff --git a/examples/vhost/main.c b/examples/vhost/main.c -index 645cf51e9..5e914f58e 100644 +index 82660a673..9a1ec0341 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c -@@ -353,11 +353,19 @@ port_init(uint16_t port) +@@ -400,11 +400,19 @@ port_init(uint16_t port) static int us_vhost_parse_socket_path(const char *q_arg) {