Skip to content

Commit 292bff9

Browse files
Colin Ian KingKalle Valo
authored andcommitted
ath11k: add missing null check on allocated skb
Currently the null check on a newly allocated skb is missing and this can lead to a null pointer dereference is the allocation fails. Fix this by adding a null check and returning -ENOMEM. Addresses-Coverity: ("Dereference null return") Fixes: 43ed15e ("ath11k: put hw to DBS using WMI_PDEV_SET_HW_MODE_CMDID") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 13458ff commit 292bff9

File tree

1 file changed

+3
-0
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+3
-0
lines changed

drivers/net/wireless/ath/ath11k/wmi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3460,6 +3460,9 @@ int ath11k_wmi_set_hw_mode(struct ath11k_base *ab,
34603460
len = sizeof(*cmd);
34613461

34623462
skb = ath11k_wmi_alloc_skb(wmi_ab, len);
3463+
if (!skb)
3464+
return -ENOMEM;
3465+
34633466
cmd = (struct wmi_pdev_set_hw_mode_cmd_param *)skb->data;
34643467

34653468
cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_HW_MODE_CMD) |

0 commit comments

Comments
 (0)