Skip to contentSkip to conversation

mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw()

PATCH In review Tuo Li 3 participants 3 messages Aug 4, 2021 – Aug 21, 2021

Subsystems (3)
lore
Share & tools
lore

Tuo Li

author
#0 lore raw

PATCH 1/1 mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw()

There is no case in which the variable cmd_node->cmd_skb has no ->data, and thus the variable host_cmd is guaranteed to be not NULL. Therefore, the null-pointer check is redundant and can be dropped.

---
 drivers/net/wireless/marvell/mwifiex/cmdevt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/cmdevt.c +1 -1
index 3a11342a6bde..171a25742600 100644
@@ -187,7 +187,7 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
 	host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data);
 
 	/* Sanity test */
-	if (host_cmd == NULL || host_cmd->size == 0) {
+	if (host_cmd->size == 0) {
 		mwifiex_dbg(adapter, ERROR,
 			    "DNLD_CMD: host_cmd is null\t"
 			    "or cmd size is 0, not sending\n");
Signature · 1 line
2.25.1
#2 lore raw
In reply to Tuo Li
Quoted 8 lines · Tuo Li

There is no case in which the variable cmd_node->cmd_skb has no ->data, and thus the variable host_cmd is guaranteed to be not NULL. Therefore, the null-pointer check is redundant and can be dropped.

Patch applied to wireless-drivers-next.git, thanks.

118934041c5f mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw()

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches