diff mbox series

wifi: mwifiex: Fix missed return in oob checks failed path

Message ID 20230810083911.3725248-1-pinkperfect2021@gmail.com (mailing list archive)
State Accepted
Commit 2785851c627f2db05f9271f7f63661b5dbd95c4c
Delegated to: Kalle Valo
Headers show
Series wifi: mwifiex: Fix missed return in oob checks failed path | expand

Commit Message

Polaris Pi Aug. 10, 2023, 8:39 a.m. UTC
Add missed return in mwifiex_uap_queue_bridged_pkt and
mwifiex_process_rx_packet.

Fixes: 119585281617 ("wifi: mwifiex: Fix OOB and integer underflow when rx packets")
Signed-off-by: Polaris Pi <pinkperfect2021@gmail.com>
---
 drivers/net/wireless/marvell/mwifiex/sta_rx.c   | 1 +
 drivers/net/wireless/marvell/mwifiex/uap_txrx.c | 1 +
 2 files changed, 2 insertions(+)

Comments

Brian Norris Aug. 10, 2023, 11:52 p.m. UTC | #1
On Thu, Aug 10, 2023 at 08:39:11AM +0000, Polaris Pi wrote:
> Add missed return in mwifiex_uap_queue_bridged_pkt and
> mwifiex_process_rx_packet.
> 
> Fixes: 119585281617 ("wifi: mwifiex: Fix OOB and integer underflow when rx packets")
> Signed-off-by: Polaris Pi <pinkperfect2021@gmail.com>

Reported-by: Dmitry Antipov <dmantipov@yandex.ru>

And:

Acked-by: Brian Norris <briannorris@chromium.org>
Kalle Valo Aug. 21, 2023, 3:57 p.m. UTC | #2
Polaris Pi <pinkperfect2021@gmail.com> wrote:

> Add missed return in mwifiex_uap_queue_bridged_pkt() and
> mwifiex_process_rx_packet().
> 
> Fixes: 119585281617 ("wifi: mwifiex: Fix OOB and integer underflow when rx packets")
> Signed-off-by: Polaris Pi <pinkperfect2021@gmail.com>
> Reported-by: Dmitry Antipov <dmantipov@yandex.ru>
> Acked-by: Brian Norris <briannorris@chromium.org>

Patch applied to wireless-next.git, thanks.

2785851c627f wifi: mwifiex: Fix missed return in oob checks failed path
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_rx.c b/drivers/net/wireless/marvell/mwifiex/sta_rx.c
index f2899d53a43f..65420ad67416 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_rx.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_rx.c
@@ -92,6 +92,7 @@  int mwifiex_process_rx_packet(struct mwifiex_private *priv,
 			    skb->len, rx_pkt_off);
 		priv->stats.rx_dropped++;
 		dev_kfree_skb_any(skb);
+		return -1;
 	}
 
 	if ((!memcmp(&rx_pkt_hdr->rfc1042_hdr, bridge_tunnel_header,
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_txrx.c b/drivers/net/wireless/marvell/mwifiex/uap_txrx.c
index 04ff051f5d18..c1b8d41dd753 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_txrx.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_txrx.c
@@ -110,6 +110,7 @@  static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv,
 			    skb->len, le16_to_cpu(uap_rx_pd->rx_pkt_offset));
 		priv->stats.rx_dropped++;
 		dev_kfree_skb_any(skb);
+		return;
 	}
 
 	if ((!memcmp(&rx_pkt_hdr->rfc1042_hdr, bridge_tunnel_header,