diff mbox

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

Message ID 1463524241-11351-1-git-send-email-xypron.glpk@gmx.de (mailing list archive)
State Accepted
Commit 9b648d788d7841867eea220904dfb77df35f1e08
Delegated to: Kalle Valo
Headers show

Commit Message

Heinrich Schuchardt May 17, 2016, 10:30 p.m. UTC
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(-)

Comments

David Miller May 19, 2016, 6:31 p.m. UTC | #1
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kalle Valo June 14, 2016, 2:18 p.m. UTC | #2
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> 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>

Thanks, 1 patch applied to wireless-drivers-next.git:

9b648d788d78 rsi: eliminate superfluous NULL check
diff mbox

Patch

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