netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bridge: remove unnecessary check for vtbegin in br_fill_vlan_tinfo_range
@ 2017-02-07 14:43 Roopa Prabhu via Bridge
  2017-02-07 19:14 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Roopa Prabhu via Bridge @ 2017-02-07 14:43 UTC (permalink / raw)
  To: davem; +Cc: nikolay, netdev, bridge, dan.carpenter

From: Roopa Prabhu <roopa@cumulusnetworks.com>

vtbegin should not be NULL in this function, Its already checked by the
caller.

this should silence the below smatch complaint:
  net/bridge/br_netlink_tunnel.c:144 br_fill_vlan_tinfo_range()
    error: we previously assumed 'vtbegin' could be null (see line 130)

net/bridge/br_netlink_tunnel.c
   129
   130      if (vtbegin && vtend && (vtend->vid - vtbegin->vid) > 0) {
                    ^^^^^^^
Check for NULL.

Fixes: efa5356b0d97 ("bridge: per vlan dst_metadata netlink support")
Reported-By: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
 net/bridge/br_netlink_tunnel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_netlink_tunnel.c b/net/bridge/br_netlink_tunnel.c
index 99c6801..4c1303b 100644
--- a/net/bridge/br_netlink_tunnel.c
+++ b/net/bridge/br_netlink_tunnel.c
@@ -127,7 +127,7 @@ static int br_fill_vlan_tinfo_range(struct sk_buff *skb,
 {
 	int err;
 
-	if (vtbegin && vtend && (vtend->vid - vtbegin->vid) > 0) {
+	if (vtend && (vtend->vid - vtbegin->vid) > 0) {
 		/* add range to skb */
 		err = br_fill_vlan_tinfo(skb, vtbegin->vid,
 					 vtbegin->tinfo.tunnel_id,
-- 
1.7.10.4

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

* Re: [PATCH net-next] bridge: remove unnecessary check for vtbegin in br_fill_vlan_tinfo_range
  2017-02-07 14:43 [PATCH net-next] bridge: remove unnecessary check for vtbegin in br_fill_vlan_tinfo_range Roopa Prabhu via Bridge
@ 2017-02-07 19:14 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-02-07 19:14 UTC (permalink / raw)
  To: roopa; +Cc: nikolay, netdev, bridge, dan.carpenter

From: Roopa Prabhu <roopa@cumulusnetworks.com>
Date: Tue,  7 Feb 2017 06:43:23 -0800

> From: Roopa Prabhu <roopa@cumulusnetworks.com>
> 
> vtbegin should not be NULL in this function, Its already checked by the
> caller.
> 
> this should silence the below smatch complaint:
>   net/bridge/br_netlink_tunnel.c:144 br_fill_vlan_tinfo_range()
>     error: we previously assumed 'vtbegin' could be null (see line 130)
> 
> net/bridge/br_netlink_tunnel.c
>    129
>    130      if (vtbegin && vtend && (vtend->vid - vtbegin->vid) > 0) {
>                     ^^^^^^^
> Check for NULL.
> 
> Fixes: efa5356b0d97 ("bridge: per vlan dst_metadata netlink support")
> Reported-By: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Applied.

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

end of thread, other threads:[~2017-02-07 19:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-07 14:43 [PATCH net-next] bridge: remove unnecessary check for vtbegin in br_fill_vlan_tinfo_range Roopa Prabhu via Bridge
2017-02-07 19:14 ` David Miller

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