mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-10 16:54:34 -05:00
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. 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> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210804020305.29812-1-islituo@gmail.com
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user