From: Weiguo Li <liwg06@foxmail.com>
To: andrew.rybchenko@oktetlabs.ru
Cc: ivan.ilchenko@oktetlabs.ru, dev@dpdk.org, stable@dpdk.org
Subject: [PATCH] net/sfc: fix the argument to sizeof for unit cache
Date: Tue, 21 Dec 2021 14:41:22 +0800 [thread overview]
Message-ID: <tencent_1990BE73477645EE63B078424EDD235E7409@qq.com> (raw)
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
next reply other threads:[~2021-12-21 6:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-21 6:41 Weiguo Li [this message]
2022-02-18 14:38 ` Ferruh Yigit
2022-02-18 14:43 ` Andrew Rybchenko
2022-02-18 15:50 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_1990BE73477645EE63B078424EDD235E7409@qq.com \
--to=liwg06@foxmail.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ivan.ilchenko@oktetlabs.ru \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).