diff mbox

tipc: remove an unnecessary NULL check

Message ID 20160427080528.GA22469@mwanda
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Dan Carpenter April 27, 2016, 8:05 a.m. UTC
This is never called with a NULL "buf" and anyway, we dereference 's' on
the lines before so it would Oops before we reach the check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Ying Xue April 27, 2016, 10:51 a.m. UTC | #1
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]

> Sent: 2016年4月27日 16:05

> To: Jon Maloy

> Cc: Xue, Ying; David S. Miller; netdev@vger.kernel.org; tipc-

> discussion@lists.sourceforge.net; kernel-janitors@vger.kernel.org

> Subject: [patch] tipc: remove an unnecessary NULL check

> 

> This is never called with a NULL "buf" and anyway, we dereference 's' on the

> lines before so it would Oops before we reach the check.

> 

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>


Acked-by: Ying Xue <ying.xue@windriver.com>


> 

> diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index 79de588..0dd0224

> 100644

> --- a/net/tipc/subscr.c

> +++ b/net/tipc/subscr.c

> @@ -326,8 +326,7 @@ static void tipc_subscrb_rcv_cb(struct net *net, int

> conid,

>  		return tipc_subscrp_cancel(s, subscriber);

>  	}

> 

> -	if (s)

> -		tipc_subscrp_subscribe(net, s, subscriber, swap);

> +	tipc_subscrp_subscribe(net, s, subscriber, swap);

>  }

> 

>  /* Handle one request to establish a new subscriber */
David Miller April 28, 2016, 8:54 p.m. UTC | #2
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 27 Apr 2016 11:05:28 +0300

> This is never called with a NULL "buf" and anyway, we dereference 's' on
> the lines before so it would Oops before we reach the check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied to net-next, thanks.
diff mbox

Patch

diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 79de588..0dd0224 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -326,8 +326,7 @@  static void tipc_subscrb_rcv_cb(struct net *net, int conid,
 		return tipc_subscrp_cancel(s, subscriber);
 	}
 
-	if (s)
-		tipc_subscrp_subscribe(net, s, subscriber, swap);
+	tipc_subscrp_subscribe(net, s, subscriber, swap);
 }
 
 /* Handle one request to establish a new subscriber */