All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] skbuff: remove unused variable `doff'
@ 2016-05-10 16:38 Sowmini Varadhan
  2016-05-10 20:05 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sowmini Varadhan @ 2016-05-10 16:38 UTC (permalink / raw)
  To: netdev; +Cc: davem, daniel, sowmini.varadhan

There are two instances of an unused variable, `doff' added by
commit 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function")
in pskb_carve_inside_header() and pskb_carve_inside_nonlinear().
Remove these instances, they are not used.

Reported by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
 net/core/skbuff.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 5586be9..f2b77e5 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4634,7 +4634,6 @@ static int pskb_carve_inside_header(struct sk_buff *skb, const u32 off,
 	int size = skb_end_offset(skb);
 	int new_hlen = headlen - off;
 	u8 *data;
-	int doff = 0;
 
 	size = SKB_DATA_ALIGN(size);
 
@@ -4674,13 +4673,11 @@ static int pskb_carve_inside_header(struct sk_buff *skb, const u32 off,
 		skb_free_head(skb);
 	}
 
-	doff = (data - skb->head);
 	skb->head = data;
 	skb->data = data;
 	skb->head_frag = 0;
 #ifdef NET_SKBUFF_DATA_USES_OFFSET
 	skb->end = size;
-	doff = 0;
 #else
 	skb->end = skb->head + size;
 #endif
@@ -4761,7 +4758,6 @@ static int pskb_carve_inside_nonlinear(struct sk_buff *skb, const u32 off,
 	u8 *data;
 	const int nfrags = skb_shinfo(skb)->nr_frags;
 	struct skb_shared_info *shinfo;
-	int doff = 0;
 
 	size = SKB_DATA_ALIGN(size);
 
@@ -4816,13 +4812,11 @@ static int pskb_carve_inside_nonlinear(struct sk_buff *skb, const u32 off,
 	}
 	skb_release_data(skb);
 
-	doff = (data - skb->head);
 	skb->head = data;
 	skb->head_frag = 0;
 	skb->data = data;
 #ifdef NET_SKBUFF_DATA_USES_OFFSET
 	skb->end = size;
-	doff = 0;
 #else
 	skb->end = skb->head + size;
 #endif
-- 
1.7.1

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

* Re: [PATCH net-next] skbuff: remove unused variable `doff'
  2016-05-10 16:38 [PATCH net-next] skbuff: remove unused variable `doff' Sowmini Varadhan
@ 2016-05-10 20:05 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-05-10 20:05 UTC (permalink / raw)
  To: sowmini.varadhan; +Cc: netdev, daniel

From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Tue, 10 May 2016 12:38:08 -0400

> There are two instances of an unused variable, `doff' added by
> commit 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function")
> in pskb_carve_inside_header() and pskb_carve_inside_nonlinear().
> Remove these instances, they are not used.
> 
> Reported by: Daniel Borkmann <daniel@iogearbox.net>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>

Applied.

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

end of thread, other threads:[~2016-05-10 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10 16:38 [PATCH net-next] skbuff: remove unused variable `doff' Sowmini Varadhan
2016-05-10 20:05 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.