netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][ipsec-next] xfrm: use correct size to initialise sp->ovec
@ 2018-10-07  2:22 Li RongQing
  2018-10-09  8:20 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Li RongQing @ 2018-10-07  2:22 UTC (permalink / raw)
  To: netdev, steffen.klassert

This place should want to initialize array, not a element,
so it should be sizeof(array) instead of sizeof(element)

but now this array only has one element, so no error in
this condition that XFRM_MAX_OFFLOAD_DEPTH is 1

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/xfrm/xfrm_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index be3520e429c9..684c0bc01e2c 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -131,7 +131,7 @@ struct sec_path *secpath_dup(struct sec_path *src)
 	sp->len = 0;
 	sp->olen = 0;
 
-	memset(sp->ovec, 0, sizeof(sp->ovec[XFRM_MAX_OFFLOAD_DEPTH]));
+	memset(sp->ovec, 0, sizeof(sp->ovec));
 
 	if (src) {
 		int i;
-- 
2.16.2

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

* Re: [PATCH][ipsec-next] xfrm: use correct size to initialise sp->ovec
  2018-10-07  2:22 [PATCH][ipsec-next] xfrm: use correct size to initialise sp->ovec Li RongQing
@ 2018-10-09  8:20 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2018-10-09  8:20 UTC (permalink / raw)
  To: Li RongQing; +Cc: netdev

On Sun, Oct 07, 2018 at 10:22:42AM +0800, Li RongQing wrote:
> This place should want to initialize array, not a element,
> so it should be sizeof(array) instead of sizeof(element)
> 
> but now this array only has one element, so no error in
> this condition that XFRM_MAX_OFFLOAD_DEPTH is 1
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Also applied, thanks a lot Li!

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

end of thread, other threads:[~2018-10-09 15:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-07  2:22 [PATCH][ipsec-next] xfrm: use correct size to initialise sp->ovec Li RongQing
2018-10-09  8:20 ` Steffen Klassert

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).