From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A55F0A04DD for ; Wed, 28 Oct 2020 11:48:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 99E2AC9D6; Wed, 28 Oct 2020 11:48:25 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 9E44DC9F0 for ; Wed, 28 Oct 2020 11:48:24 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id w1so5162895wrm.4 for ; Wed, 28 Oct 2020 03:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MtV+cwiLy44BQmKvUsKSH4SdQ96AWZCcj4uUtJOuhIU=; b=ix485LjPkKS1cYrirz1xm0/juLOhXBeA3H+urXmaOaTPjDqSuR3DZk52V5/bC24Lub E38iH0APMKmhieW7odXAhZi+M0V35LpgT5PoeUSPDX4TMYzdk5dgFJ5/3Y0EDKZT9LVs cN3JNNJfv9AsPearaP+XMVJHVtm14cuKpLG8SB9AMF24Vqz8PI2CAgR8mmBoHELLt8oO 9CS3Yp3FWSmsI3WjRHmSHBMbctOdTvP79zMIeiIbr66zYFOSY82KiNAJGyzFfpMfb3JZ zzQYixzsCLSkwRwcEWxLtBFF4gnVJNS5ugO/6atZeXCaFVSqBZMBIDbbIrmTmtcp1E+k iykA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MtV+cwiLy44BQmKvUsKSH4SdQ96AWZCcj4uUtJOuhIU=; b=R1aTLhNNRWeZ+gsuTtsrmrL0dmGXYUkUWlfdUcwrJBvnzz/W+4/wq4FWlsQ9KFxx6J 9VnES2qy7+YLGKsIx4tJI92nDNBv3VPZNSM+YvdRfz9LMggAkXRPThIa6azRLCyHUtbi tD9Hn5bCQD60nNd3goMlA6Vx0syo3dl9HtQz4aRH01bJIM3OyGdAkzEajhpjlI54lgu5 XnjMCWCrAdRIx7TEwfcyIU1zh02VTcOBU8ROGULKsx3Syq2fqbys/oTweadk5qG4hHdI uQg1O3HDxdMk7DjnAx/1i7ENBpnzh+HTnpjaNt+N0EEQ3I5CS3LIrGWcIhJ6Q43c3YFE cm9A== X-Gm-Message-State: AOAM5314kFM4WdwS7Bdi4Otzq9NUYD4b+fio8o7GbTQ0fsoHW3AR27T9 V4HO5uuGLpWQ0nyQQTn0KrI= X-Google-Smtp-Source: ABdhPJw+EUcT5A2v+hKLeyoDSXdtmAoL8PntPBA09tXKVq495gsi1ObEMMEgFtkpbe5aFYeqlS2Nyw== X-Received: by 2002:adf:f146:: with SMTP id y6mr1799265wro.418.1603882103376; Wed, 28 Oct 2020 03:48:23 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id o186sm5947962wmb.12.2020.10.28.03.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:48:22 -0700 (PDT) From: luca.boccassi@gmail.com To: Yunjian Wang Cc: Hemant Agrawal , dpdk stable Date: Wed, 28 Oct 2020 10:43:22 +0000 Message-Id: <20201028104606.3504127-43-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'bus/dpaa: fix fd check before close' has been queued to stable release 19.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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/20. 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. Luca Boccassi --- >From cf1ded5fa15cd96ab87a7210754ba65dfad7aed2 Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Tue, 15 Sep 2020 19:57:40 +0800 Subject: [PATCH] bus/dpaa: fix fd check before close [ upstream commit c61dc9713666e8c707352ec7d4ec23e4c4d9fdc7 ] The fd is possibly a negative value while it is passed as an argument to function "close". Fix the check to the fd. Fixes: b9c94167904f ("bus/dpaa: decouple FQ portal alloc and init") Signed-off-by: Yunjian Wang Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman_driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 464998fe91..e1dee17542 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -132,7 +132,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) struct qm_portal_config *q_pcfg; struct dpaa_ioctl_irq_map irq_map; struct dpaa_ioctl_portal_map q_map = {0}; - int q_fd = 0, ret; + int q_fd, ret; q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { @@ -169,7 +169,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) if (!portal) { pr_err("Qman portal initialisation failed (%d)\n", q_pcfg->cpu); - goto err; + goto err_alloc; } irq_map.type = dpaa_portal_qman; @@ -178,9 +178,9 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) *fd = q_fd; return portal; +err_alloc: + close(q_fd); err: - if (q_fd) - close(q_fd); process_portal_unmap(&q_map.addr); kfree(q_pcfg); return NULL; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:13.135903536 +0000 +++ 0043-bus-dpaa-fix-fd-check-before-close.patch 2020-10-28 10:35:11.504830024 +0000 @@ -1,13 +1,14 @@ -From c61dc9713666e8c707352ec7d4ec23e4c4d9fdc7 Mon Sep 17 00:00:00 2001 +From cf1ded5fa15cd96ab87a7210754ba65dfad7aed2 Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Tue, 15 Sep 2020 19:57:40 +0800 Subject: [PATCH] bus/dpaa: fix fd check before close +[ upstream commit c61dc9713666e8c707352ec7d4ec23e4c4d9fdc7 ] + The fd is possibly a negative value while it is passed as an argument to function "close". Fix the check to the fd. Fixes: b9c94167904f ("bus/dpaa: decouple FQ portal alloc and init") -Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Acked-by: Hemant Agrawal @@ -16,10 +17,10 @@ 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c -index a466c698fc..6d9aaff164 100644 +index 464998fe91..e1dee17542 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c -@@ -142,7 +142,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) +@@ -132,7 +132,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) struct qm_portal_config *q_pcfg; struct dpaa_ioctl_irq_map irq_map; struct dpaa_ioctl_portal_map q_map = {0}; @@ -28,7 +29,7 @@ q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { -@@ -179,7 +179,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) +@@ -169,7 +169,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) if (!portal) { pr_err("Qman portal initialisation failed (%d)\n", q_pcfg->cpu); @@ -37,7 +38,7 @@ } irq_map.type = dpaa_portal_qman; -@@ -188,9 +188,9 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) +@@ -178,9 +178,9 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) *fd = q_fd; return portal;