patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/sfc: fix the argument to sizeof for unit cache
@ 2021-12-21  6:41 Weiguo Li
  0 siblings, 0 replies; only message in thread
From: Weiguo Li @ 2021-12-21  6:41 UTC (permalink / raw)
  To: andrew.rybchenko; +Cc: ivan.ilchenko, dev, stable

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 <liwg06@foxmail.com>
---
 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;
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-21  6:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-21  6:41 [PATCH] net/sfc: fix the argument to sizeof for unit cache Weiguo Li

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git