From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 566121B544 for ; Thu, 7 Feb 2019 14:27:56 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A687AB272F; Thu, 7 Feb 2019 13:27:55 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.33.36.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F41C690F1; Thu, 7 Feb 2019 13:27:53 +0000 (UTC) From: Kevin Traynor To: Tiwei Bie Cc: Maxime Coquelin , dpdk stable Date: Thu, 7 Feb 2019 13:25:35 +0000 Message-Id: <20190207132614.20538-29-ktraynor@redhat.com> In-Reply-To: <20190207132614.20538-1-ktraynor@redhat.com> References: <20190207132614.20538-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 07 Feb 2019 13:27:55 +0000 (UTC) Subject: [dpdk-stable] patch 'examples/vhost: fix path allocation failure handling' has been queued to LTS release 18.11.1 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: Thu, 07 Feb 2019 13:27:56 -0000 Hi, FYI, your patch has been queued to LTS release 18.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/14/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >>From 4fef18491498e0e816512f963fb478f6cfc7fc07 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 c4bdd3c43..2261f089f 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -376,9 +376,17 @@ 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.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-02-07 13:19:56.220680653 +0000 +++ 0029-examples-vhost-fix-path-allocation-failure-handling.patch 2019-02-07 13:19:55.000000000 +0000 @@ -1,13 +1,14 @@ -From d79035b7dd6e599589552573b53c138f488dead3 Mon Sep 17 00:00:00 2001 +From 4fef18491498e0e816512f963fb478f6cfc7fc07 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 c4bdd3c43..2261f089f 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c -@@ -354,9 +354,17 @@ static int +@@ -376,9 +376,17 @@ static int us_vhost_parse_socket_path(const char *q_arg) { + char *old;