Skip to contentSkip to conversation

ath11k: add missing null check on allocated skb

PATCH In review Colin King 2 participants 6 messages Dec 14, 2020 – Dec 17, 2020

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 ath11k: add missing null check on allocated skb

From: Colin Ian King <[email protected]>

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 43ed15e1ee01 ("ath11k: put hw to DBS using WMI_PDEV_SET_HW_MODE_CMDID")
---
 drivers/net/wireless/ath/ath11k/wmi.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath11k/wmi.c +2 -0
index da4b546b62cb..c869ff479212 100644
@@ -3460,6 +3460,8 @@ int ath11k_wmi_set_hw_mode(struct ath11k_base *ab,
 	len = sizeof(*cmd);
 
 	skb = ath11k_wmi_alloc_skb(wmi_ab, len);
+	if (!skb)
+		return -ENOMEM;
 	cmd = (struct wmi_pdev_set_hw_mode_cmd_param *)skb->data;
 
 	cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_HW_MODE_CMD) |
Signature · 1 line
2.29.2
#1 lore raw
Quoted 8 lines · Colin King

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 43ed15e1ee01 ("ath11k: put hw to DBS using WMI_PDEV_SET_HW_MODE_CMDID")

Patch applied to ath-current branch of ath.git, thanks.

c86a36a621f2 ath11k: add missing null check on allocated skb

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

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
In reply to Colin King
Quoted 8 lines · Colin King

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 43ed15e1ee01 ("ath11k: put hw to DBS using WMI_PDEV_SET_HW_MODE_CMDID")

Patch applied to ath-current branch of ath.git, thanks.

c86a36a621f2 ath11k: add missing null check on allocated skb

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

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


-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#3 lore raw
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Colin King

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.

Quoted 8 lines
Quoted 4 lines

Addresses-Coverity: ("Dereference null return")

Fixes 43ed15e1ee01 ("ath11k: put hw to DBS using WMI_PDEV_SET_HW_MODE_CMDID")

Patch applied to ath-current branch of ath.git, thanks.

c86a36a621f2 ath11k: add missing null check on allocated skb

I did a mistake and that commit id will change, so please disregard this. There will be a new mail soon.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#4 lore raw
In reply to Colin King
Quoted 8 lines · Colin King

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 43ed15e1ee01 ("ath11k: put hw to DBS using WMI_PDEV_SET_HW_MODE_CMDID")

Patch applied to ath-current branch of ath.git, thanks.

292bff9480c8 ath11k: add missing null check on allocated skb

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

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#5 lore raw
In reply to Colin King
Quoted 8 lines · Colin King

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 43ed15e1ee01 ("ath11k: put hw to DBS using WMI_PDEV_SET_HW_MODE_CMDID")

Patch applied to ath-current branch of ath.git, thanks.

292bff9480c8 ath11k: add missing null check on allocated skb

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

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


-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k