Skip to contentSkip to conversation

ath6kl: minor fix for allocation size

PATCH In review Alexey V. Vissarionov 3 participants 3 messages Jan 17, 2023 – Feb 17, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath6kl: minor fix for allocation size

Although the "param" pointer occupies more or equal space compared to "*param", the allocation size should use the size of variable itself.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes bdcd81707973cf8a ("Add ath6kl cleaned up driver")
drivers/net/wireless/ath/ath6kl/bmi.c +1 -1
index bde5a10d470c8e74..af98e871199d317f 100644
@@ -246,7 +246,7 @@ int ath6kl_bmi_execute(struct ath6kl *ar, u32 addr, u32 *param)
 		return -EACCES;
 	}
 
-	size = sizeof(cid) + sizeof(addr) + sizeof(param);
+	size = sizeof(cid) + sizeof(addr) + sizeof(*param);
 	if (size > ar->bmi.max_cmd_size) {
 		WARN_ON(1);
 		return -EINVAL;
Signature · 3 lines
Alexey V. Vissarionov
gremlin ПРИ altlinux ТЧК org; +vii-cmiii-ccxxix-lxxix-xlii
GPG: 0D92F19E1C0DC36E27F61A29CD17E2B43D879005 @ hkp://keys.gnupg.net
#2 lore raw
In reply to Alexey V. Vissarionov
Quoted 9 lines · Alexey V. Vissarionov

Although the "param" pointer occupies more or equal space compared to "*param", the allocation size should use the size of variable itself.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes bdcd81707973cf8a ("Add ath6kl cleaned up driver")

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

778f83f889e7 wifi: ath6kl: minor fix for allocation size

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

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