Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1402636 > unrolled thread

[PATCH 1/1] net: rsi: eliminate superfluous NULL check

Started byHeinrich Schuchardt <xypron.glpk@gmx.de>
First post2016-05-18 00:40 +0200
Last post2016-05-19 20:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] net: rsi: eliminate superfluous NULL check Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-05-18 00:40 +0200
    Re: [PATCH 1/1] net: rsi: eliminate superfluous NULL check David Miller <davem@davemloft.net> - 2016-05-19 20:40 +0200

#1402636 — [PATCH 1/1] net: rsi: eliminate superfluous NULL check

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-05-18 00:40 +0200
Subject[PATCH 1/1] net: rsi: eliminate superfluous NULL check
Message-ID<rzVOF-23T-5@gated-at.bofh.it>
msg is dereferenced before checking against NULL, e.g.
when assigning pad_bytes.
Remove the superfluous check in function rsi_mgmt_pkt_to_core.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/net/wireless/rsi/rsi_91x_mgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
index 40658b6..35c14cc 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
@@ -398,7 +398,7 @@ static int rsi_mgmt_pkt_to_core(struct rsi_common *common,
 			return -ENOLINK;
 
 		msg_len -= pad_bytes;
-		if ((msg_len <= 0) || (!msg)) {
+		if (msg_len <= 0) {
 			rsi_dbg(MGMT_RX_ZONE,
 				"%s: Invalid rx msg of len = %d\n",
 				__func__, msg_len);
-- 
2.1.4

[toc] | [next] | [standalone]


#1403919

FromDavid Miller <davem@davemloft.net>
Date2016-05-19 20:40 +0200
Message-ID<rAB1w-3od-25@gated-at.bofh.it>
In reply to#1402636
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Wed, 18 May 2016 00:30:41 +0200

> msg is dereferenced before checking against NULL, e.g.
> when assigning pad_bytes.
> Remove the superfluous check in function rsi_mgmt_pkt_to_core.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

I'll let the wireless folks pick this up.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web