Re: [PATCH][netdev-next] gre: remove duplicated assignment of iph

From: David Miller
Date: Wed Aug 23 2017 - 14:46:19 EST


From: Colin King <colin.king@xxxxxxxxxxxxx>
Date: Wed, 23 Aug 2017 12:13:05 +0100

> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> iph is being assigned the same value twice; remove the redundant
> second assignment.
>
> Fixes warning:
> net/ipv4/ip_gre.c:265:2: warning: Value stored to 'iph' is never read
>
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>

It is always necessary to reload any SKB header pointer after calls
to functions which potentially change the data buffer of the SKB.

pskb_may_pull() is one such call.

Therefore your patch is adding a bug.

If you want to remove the dup, you must remove the first not
the second one.