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 744F81B3AC; Wed, 6 Feb 2019 13:19:24 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C788580F83; Wed, 6 Feb 2019 12:19:23 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.33.36.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F110608C1; Wed, 6 Feb 2019 12:19:22 +0000 (UTC) From: Kevin Traynor To: david.hunt@intel.com, dev@dpdk.org Cc: Kevin Traynor , stable@dpdk.org Date: Wed, 6 Feb 2019 12:19:06 +0000 Message-Id: <20190206121906.4231-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 06 Feb 2019 12:19:23 +0000 (UTC) Subject: [dpdk-stable] [PATCH] power: fix frequency list buffer validation 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: Wed, 06 Feb 2019 12:19:24 -0000 The frequency list buffer was already validated in power_acpi_cpufreq_freqs(), so the newly added check was redundant. To keep consistency with power_pstate_cpufreq_freqs(), remove the original check and update the log message. Fixes: 2e6ccdb4e088 ("power: fix frequency list to handle null buffer") Cc: stable@dpdk.org Signed-off-by: Kevin Traynor --- lib/librte_power/power_acpi_cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_power/power_acpi_cpufreq.c b/lib/librte_power/power_acpi_cpufreq.c index 45412f0b9..534efe817 100644 --- a/lib/librte_power/power_acpi_cpufreq.c +++ b/lib/librte_power/power_acpi_cpufreq.c @@ -441,6 +441,6 @@ power_acpi_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num) struct rte_power_info *pi; - if (lcore_id >= RTE_MAX_LCORE || !freqs) { - RTE_LOG(ERR, POWER, "Invalid input parameter\n"); + if (lcore_id >= RTE_MAX_LCORE) { + RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); return 0; } -- 2.19.0