diff mbox

openvswitch: fix odd_ptr_err.cocci warnings

Message ID 20141224064138.GA11360@athens
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

kbuild test robot Dec. 24, 2014, 6:41 a.m. UTC
net/openvswitch/vport-gre.c:188:5-11: inconsistent IS_ERR and PTR_ERR, PTR_ERR on line 189

 PTR_ERR should access the value just tested by IS_ERR

Semantic patch information:
 There can be false positives in the patch case, where it is the call
 IS_ERR that is wrong.

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

CC: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 vport-gre.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Pravin B Shelar Dec. 24, 2014, 6:49 p.m. UTC | #1
On Tue, Dec 23, 2014 at 10:41 PM, kbuild test robot
<fengguang.wu@intel.com> wrote:
> net/openvswitch/vport-gre.c:188:5-11: inconsistent IS_ERR and PTR_ERR, PTR_ERR on line 189
>
>  PTR_ERR should access the value just tested by IS_ERR
>
> Semantic patch information:
>  There can be false positives in the patch case, where it is the call
>  IS_ERR that is wrong.
>
> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
>
> CC: Pravin B Shelar <pshelar@nicira.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Thanks for the fix.

Acked-by: Pravin B Shelar <pshelar@nicira.com>

> ---
>
>  vport-gre.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/net/openvswitch/vport-gre.c
> +++ b/net/openvswitch/vport-gre.c
> @@ -186,7 +186,7 @@ static int gre_tnl_send(struct vport *vp
>         /* Push Tunnel header. */
>         skb = __build_header(skb, tunnel_hlen);
>         if (IS_ERR(skb)) {
> -               err = PTR_ERR(rt);
> +               err = PTR_ERR(skb);
>                 skb = NULL;
>                 goto err_free_rt;
>         }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 24, 2014, 8:18 p.m. UTC | #2
From: Pravin Shelar <pshelar@nicira.com>
Date: Wed, 24 Dec 2014 10:49:22 -0800

> On Tue, Dec 23, 2014 at 10:41 PM, kbuild test robot
> <fengguang.wu@intel.com> wrote:
>> net/openvswitch/vport-gre.c:188:5-11: inconsistent IS_ERR and PTR_ERR, PTR_ERR on line 189
>>
>>  PTR_ERR should access the value just tested by IS_ERR
>>
>> Semantic patch information:
>>  There can be false positives in the patch case, where it is the call
>>  IS_ERR that is wrong.
>>
>> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
>>
>> CC: Pravin B Shelar <pshelar@nicira.com>
>> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> 
> Thanks for the fix.
> 
> Acked-by: Pravin B Shelar <pshelar@nicira.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/net/openvswitch/vport-gre.c
+++ b/net/openvswitch/vport-gre.c
@@ -186,7 +186,7 @@  static int gre_tnl_send(struct vport *vp
 	/* Push Tunnel header. */
 	skb = __build_header(skb, tunnel_hlen);
 	if (IS_ERR(skb)) {
-		err = PTR_ERR(rt);
+		err = PTR_ERR(skb);
 		skb = NULL;
 		goto err_free_rt;
 	}