]> git.baikalelectronics.ru Git - kernel.git/commit
wifi: mt76: fix coverity uninit_use_in_call in mt76_connac2_reverse_frag0_hdr_trans()
authorDeren Wu <deren.wu@mediatek.com>
Wed, 7 Dec 2022 16:03:10 +0000 (00:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:32:47 +0000 (09:32 +0100)
commitf8193e6477b7ab419e118ebad574f7431cb0e43d
tree7b4fafebb053fdea47b60565773847446b06a2f4
parent399ddec8976b5f54ed8a63f64622a2e7c6eafa96
wifi: mt76: fix coverity uninit_use_in_call in mt76_connac2_reverse_frag0_hdr_trans()

[ Upstream commit 03e5d63928bda2f8ae472f03ca448f5c994cbcee ]

The default case for frame_contorl is invalid. We should always
assign addr3 of this frame properly.

Coverity error message:
if (ieee80211_has_a4(hdr.frame_control))
(19) Event uninit_use_in_call: Using uninitialized value "hdr".
Field "hdr.addr3" is uninitialized when calling "memcpy".
memcpy(skb_push(skb, sizeof(hdr)), &hdr, sizeof(hdr));
else
memcpy(skb_push(skb, sizeof(hdr) - 6), &hdr, sizeof(hdr) - 6);

Fixes: 0f363090a75f ("mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module")
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c