LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw()
@ 2021-08-04  2:03 Tuo Li
  2021-08-04 22:45 ` Brian Norris
  2021-08-21 17:49 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Tuo Li @ 2021-08-04  2:03 UTC (permalink / raw)
  To: amitkarwar, ganapathi017, sharvari.harisangam, huxinming820,
	kvalo, davem, kuba
  Cc: linux-wireless, netdev, linux-kernel, baijiaju1990, Tuo Li, TOTE Robot

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.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Tuo Li <islituo@gmail.com>
---
 drivers/net/wireless/marvell/mwifiex/cmdevt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index 3a11342a6bde..171a25742600 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -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");
-- 
2.25.1


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

* Re: [PATCH] mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw()
  2021-08-04  2:03 [PATCH] mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw() Tuo Li
@ 2021-08-04 22:45 ` Brian Norris
  2021-08-21 17:49 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Norris @ 2021-08-04 22:45 UTC (permalink / raw)
  To: Tuo Li
  Cc: amit karwar, Ganapathi Bhat, Sharvari Harisangam, Xinming Hu,
	Kalle Valo, David S. Miller, Jakub Kicinski, linux-wireless,
	<netdev@vger.kernel.org>,
	Linux Kernel, baijiaju1990, TOTE Robot

On Tue, Aug 3, 2021 at 7:03 PM Tuo Li <islituo@gmail.com> wrote:
>
> 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.
>
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Tuo Li <islituo@gmail.com>

Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>

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

* Re: [PATCH] mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw()
  2021-08-04  2:03 [PATCH] mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw() Tuo Li
  2021-08-04 22:45 ` Brian Norris
@ 2021-08-21 17:49 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-08-21 17:49 UTC (permalink / raw)
  To: Tuo Li
  Cc: amitkarwar, ganapathi017, sharvari.harisangam, huxinming820,
	davem, kuba, linux-wireless, netdev, linux-kernel, baijiaju1990,
	Tuo Li, TOTE Robot

Tuo Li <islituo@gmail.com> wrote:

> 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.
> 
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Tuo Li <islituo@gmail.com>
> Tested-by: Brian Norris <briannorris@chromium.org>
> Reviewed-by: Brian Norris <briannorris@chromium.org>

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

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

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210804020305.29812-1-islituo@gmail.com/

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


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

end of thread, other threads:[~2021-08-21 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04  2:03 [PATCH] mwifiex: drop redundant null-pointer check in mwifiex_dnld_cmd_to_fw() Tuo Li
2021-08-04 22:45 ` Brian Norris
2021-08-21 17:49 ` Kalle Valo

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