From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CE5E5A00BE for ; Fri, 18 Feb 2022 15:43:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6C0D410FB; Fri, 18 Feb 2022 15:43:48 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 680CB40141; Fri, 18 Feb 2022 15:43:47 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id B1C1944; Fri, 18 Feb 2022 17:43:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru B1C1944 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1645195426; bh=gQwhxxitz5N4Jy1x4HjsqXQNpTbGO9+oXU2Z5pl3pAo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=uBTlTLHKMlMiMMzQBrSFIprvh5XS3rgNiVCFa+8uCf5kCV9qf5ZU4B61WJsPBIPoj hHU2RtIomcwx3rxcq4xe9bt93HUHOTsPp83P/BYzVFFRVzOF83i8C6YlVjwNPk9GHK qNZb3sEel0vcy6JVf4S5lni4xFiLemcGXf8BqMwU= Message-ID: <8c95121b-bb87-55c0-5d2b-d98f19c87283@oktetlabs.ru> Date: Fri, 18 Feb 2022 17:43:46 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] net/sfc: fix the argument to sizeof for unit cache Content-Language: en-US To: Ferruh Yigit , Weiguo Li Cc: ivan.ilchenko@oktetlabs.ru, dev@dpdk.org, stable@dpdk.org References: <191c80de-37d4-da06-5fef-fdc3e47c58cb@intel.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <191c80de-37d4-da06-5fef-fdc3e47c58cb@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 On 2/18/22 17:38, Ferruh Yigit wrote: > On 12/21/2021 6:41 AM, Weiguo Li wrote: >> The size of unit cache should be sizeof(**cache) instead of >> sizeof(*cache). Memory reallocation is inadequate by sizeof(*cache) >> for the platform whose size of pointer is 32-bits. Found by coccinelle >> (see https://coccinelle.gitlabpages.inria.fr/website) script. >> >> Fixes: 63abf8d29225 ("net/sfc: support SW stats groups") >> Cc: stable@dpdk.org >> >> Signed-off-by: Weiguo Li >> --- >>   drivers/net/sfc/sfc_sw_stats.c | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/sfc/sfc_sw_stats.c >> b/drivers/net/sfc/sfc_sw_stats.c >> index 70259660c0..81f5aa3cc4 100644 >> --- a/drivers/net/sfc/sfc_sw_stats.c >> +++ b/drivers/net/sfc/sfc_sw_stats.c >> @@ -777,7 +777,7 @@ sfc_sw_xstats_configure(struct sfc_adapter *sa) >>       memset(*reset_vals, 0, nb_supported * sizeof(**reset_vals)); >> -    *cache = rte_realloc(*cache, cache_count * sizeof(*cache), 0); >> +    *cache = rte_realloc(*cache, cache_count * sizeof(**cache), 0); >>       if (*cache == NULL) { >>           rc = ENOMEM; >>           goto fail_cache; > > > Hi Andrew, Ivan, > > This patch seems missed, and it looks a valid fix to me. > > Do you have any comment on patch? Hi, sorry, lost from my view as well. Reviewed-by: Andrew Rybchenko Thanks, Andrew.