All of lore.kernel.org
 help / color / mirror / Atom feed
* re: ipvlan: Initial check-in of the IPVLAN driver.
@ 2015-01-19 14:40 Dan Carpenter
  2015-01-19 21:20 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2015-01-19 14:40 UTC (permalink / raw)
  To: maheshb; +Cc: netdev

Hello Mahesh Bandewar,

The patch 2ad7bf363841: "ipvlan: Initial check-in of the IPVLAN
driver." from Nov 23, 2014, leads to the following static checker
warning:

	drivers/net/ipvlan/ipvlan_core.c:380 ipvlan_process_v6_outbound()
	warn: 'dst' isn't an ERR_PTR

drivers/net/ipvlan/ipvlan_core.c
   378  
   379          dst = ip6_route_output(dev_net(dev), NULL, &fl6);
   380          if (IS_ERR(dst))
   381                  goto err;

The ip6_route_output() function is not documented but it always returns
a valid pointer.  I believe you are supposed to check something like:

		if (dst->error) {
			ret = dst->error;
			goto error;
		}

   382  
   383          skb_dst_drop(skb);
   384          skb_dst_set(skb, dst);

regards,
dan carpenter

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

* Re: ipvlan: Initial check-in of the IPVLAN driver.
  2015-01-19 14:40 ipvlan: Initial check-in of the IPVLAN driver Dan Carpenter
@ 2015-01-19 21:20 ` David Miller
  2015-01-23 22:40   ` Mahesh Bandewar
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2015-01-19 21:20 UTC (permalink / raw)
  To: dan.carpenter; +Cc: maheshb, netdev

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Mon, 19 Jan 2015 17:40:11 +0300

> The patch 2ad7bf363841: "ipvlan: Initial check-in of the IPVLAN
> driver." from Nov 23, 2014, leads to the following static checker
> warning:
> 
> 	drivers/net/ipvlan/ipvlan_core.c:380 ipvlan_process_v6_outbound()
> 	warn: 'dst' isn't an ERR_PTR
> 
> drivers/net/ipvlan/ipvlan_core.c
>    378  
>    379          dst = ip6_route_output(dev_net(dev), NULL, &fl6);
>    380          if (IS_ERR(dst))
>    381                  goto err;
> 
> The ip6_route_output() function is not documented but it always returns
> a valid pointer.  I believe you are supposed to check something like:
> 
> 		if (dst->error) {
> 			ret = dst->error;
> 			goto error;
> 		}
> 
>    382  
>    383          skb_dst_drop(skb);
>    384          skb_dst_set(skb, dst);

This is correct.

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

* Re: ipvlan: Initial check-in of the IPVLAN driver.
  2015-01-19 21:20 ` David Miller
@ 2015-01-23 22:40   ` Mahesh Bandewar
  0 siblings, 0 replies; 3+ messages in thread
From: Mahesh Bandewar @ 2015-01-23 22:40 UTC (permalink / raw)
  To: David Miller; +Cc: dan.carpenter, linux-netdev

On Mon, Jan 19, 2015 at 1:20 PM, David Miller <davem@davemloft.net> wrote:
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Date: Mon, 19 Jan 2015 17:40:11 +0300
>
>> The patch 2ad7bf363841: "ipvlan: Initial check-in of the IPVLAN
>> driver." from Nov 23, 2014, leads to the following static checker
>> warning:
>>
>>       drivers/net/ipvlan/ipvlan_core.c:380 ipvlan_process_v6_outbound()
>>       warn: 'dst' isn't an ERR_PTR
>>
>> drivers/net/ipvlan/ipvlan_core.c
>>    378
>>    379          dst = ip6_route_output(dev_net(dev), NULL, &fl6);
>>    380          if (IS_ERR(dst))
>>    381                  goto err;
>>
>> The ip6_route_output() function is not documented but it always returns
>> a valid pointer.  I believe you are supposed to check something like:
>>
>>               if (dst->error) {
>>                       ret = dst->error;
>>                       goto error;
>>               }
>>
>>    382
>>    383          skb_dst_drop(skb);
>>    384          skb_dst_set(skb, dst);
>
> This is correct.

Thanks Dan for pointing it out. I'll send a patch correcting that code.

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

end of thread, other threads:[~2015-01-23 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19 14:40 ipvlan: Initial check-in of the IPVLAN driver Dan Carpenter
2015-01-19 21:20 ` David Miller
2015-01-23 22:40   ` Mahesh Bandewar

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.