* [PATCH] mt76: usb: remove WARN_ON in mt76u_get_rx_entry_len [not found] ` <cover.1537272524.git.lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2018-09-18 12:12 ` Lorenzo Bianconi [not found] ` <c9d8d73f3353c2ad953d8a298c52a32922ed2bcc.1537272524.git.lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 2+ messages in thread From: Lorenzo Bianconi @ 2018-09-18 12:12 UTC (permalink / raw) To: nbd-Vt+b4OUoWG0 Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Remove not useful WARN_ON macros in mt76u_get_rx_entry_len routine since corrupted frames should just be silently discarded Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> --- drivers/net/wireless/mediatek/mt76/usb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index 7780b07543bb..81f036b3df86 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -326,9 +326,9 @@ static int mt76u_get_rx_entry_len(u8 *data, u32 data_len) min_len = MT_DMA_HDR_LEN + MT_RX_RXWI_LEN + MT_FCE_INFO_LEN; - if (data_len < min_len || WARN_ON(!dma_len) || - WARN_ON(dma_len + MT_DMA_HDR_LEN > data_len) || - WARN_ON(dma_len & 0x3)) + if (data_len < min_len || !dma_len || + dma_len + MT_DMA_HDR_LEN > data_len || + (dma_len & 0x3)) return -EINVAL; return dma_len; } -- 2.17.1 ^ permalink raw reply related [flat|nested] 2+ messages in thread
[parent not found: <c9d8d73f3353c2ad953d8a298c52a32922ed2bcc.1537272524.git.lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] mt76: usb: remove WARN_ON in mt76u_get_rx_entry_len [not found] ` <c9d8d73f3353c2ad953d8a298c52a32922ed2bcc.1537272524.git.lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2018-09-22 12:04 ` Felix Fietkau 0 siblings, 0 replies; 2+ messages in thread From: Felix Fietkau @ 2018-09-22 12:04 UTC (permalink / raw) To: Lorenzo Bianconi Cc: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-wireless-u79uwXL29TY76Z2rM5mHXA On 2018-09-18 14:12, Lorenzo Bianconi wrote: > Remove not useful WARN_ON macros in mt76u_get_rx_entry_len routine > since corrupted frames should just be silently discarded > > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Merged, thanks. ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-22 12:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1537272524.git.lorenzo.bianconi@redhat.com>
[not found] ` <cover.1537272524.git.lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-18 12:12 ` [PATCH] mt76: usb: remove WARN_ON in mt76u_get_rx_entry_len Lorenzo Bianconi
[not found] ` <c9d8d73f3353c2ad953d8a298c52a32922ed2bcc.1537272524.git.lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-22 12:04 ` Felix Fietkau
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox