Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: rtnetlink: fix correct size given to memset
@ 2014-02-11 14:06 Francois-Xavier Le Bail
  2014-02-11 15:28 ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Francois-Xavier Le Bail @ 2014-02-11 14:06 UTC (permalink / raw)
  To: NETDEV, David Miller

Find by cppcheck:
[net/core/rtnetlink.c:1842]: (warning) Using size of pointer linkinfo instead of size of its data.

Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
---

The diagnosis of cppcheck seems relevant.

 net/core/rtnetlink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 048dc8d..9a5dbf1 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1839,7 +1839,7 @@ replay:
 		if (err < 0)
 			return err;
 	} else
-		memset(linkinfo, 0, sizeof(linkinfo));
+		memset(linkinfo, 0, sizeof(*linkinfo));
 
 	if (linkinfo[IFLA_INFO_KIND]) {
 		nla_strlcpy(kind, linkinfo[IFLA_INFO_KIND], sizeof(kind));

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-11 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 14:06 [PATCH] net: rtnetlink: fix correct size given to memset Francois-Xavier Le Bail
2014-02-11 15:28 ` Eric Dumazet
2014-02-11 15:54   ` David Laight
2014-02-11 16:01   ` François-Xavier Le Bail

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox