From patchwork Tue Sep 18 12:12:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10604263 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B900E5A4 for ; Tue, 18 Sep 2018 12:12:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7D182A77C for ; Tue, 18 Sep 2018 12:12:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BA0A2A798; Tue, 18 Sep 2018 12:12:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4404C2A77C for ; Tue, 18 Sep 2018 12:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbeIRRoa (ORCPT ); Tue, 18 Sep 2018 13:44:30 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41077 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbeIRRoa (ORCPT ); Tue, 18 Sep 2018 13:44:30 -0400 Received: by mail-wr1-f68.google.com with SMTP id z96-v6so1832187wrb.8 for ; Tue, 18 Sep 2018 05:12:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wb5FR+Ea1p6mzr6OKQ7oktBbkIl4XQKrRkpmkZU3OZw=; b=awN5sPkX7odBOzuwvXwalTgNuKg/LsqS+V4doMeR8qzMuQMeDyYiJpJHXGiMLA4DwJ YUOyysLErAEao+YK0uSYCLrOoSux14CrilM0LVeLCo8E83DGz6wwXjCDUU3sO2Fj34FD pDfRIXtpnyEh8Tr+BUwpaY3uosKi55IVcwp2jDmrF+n5MpruvRuRtOjsJmXjo3//uPL1 yst8nQW/mGYu8eYeAQkDdUFtZEEsngn+Sv5y1d+r9ROcMDriuXVb6jb4ZsFyzVmigni0 0BC/DaVLaw8pSV826dOBlIm5hmdyKEWV3cITyt9GMNcp/sB4sSV6zfUAKy/rubc7kErS F4iw== X-Gm-Message-State: APzg51BSCjP5uUi8RpCFqP5g2HjApnGM6hwQIZnKwVbpsN1G3TnAGbIy cZu6e7FqD5c3VUHgfQ4cv3uhuw== X-Google-Smtp-Source: ANB0VdZWyMJjp90zJZjg5/fAz2I1kBsOTQ6WYIa4OnzqWHoBBH4t9FIJzb4ttfqLbkblG4ApDoUiDQ== X-Received: by 2002:a5d:4e0a:: with SMTP id p10-v6mr22309790wrt.48.1537272730096; Tue, 18 Sep 2018 05:12:10 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id c19-v6sm19766610wre.86.2018.09.18.05.12.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Sep 2018 05:12:09 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH] mt76: usb: remove WARN_ON in mt76u_get_rx_entry_len Date: Tue, 18 Sep 2018 14:12:05 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }