From patchwork Mon Mar 7 02:13:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith Manoharan X-Patchwork-Id: 614191 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p272Dxl6017950 for ; Mon, 7 Mar 2011 02:13:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755146Ab1CGCN5 (ORCPT ); Sun, 6 Mar 2011 21:13:57 -0500 Received: from mail-pw0-f46.google.com ([209.85.160.46]:40265 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755137Ab1CGCN4 (ORCPT ); Sun, 6 Mar 2011 21:13:56 -0500 Received: by mail-pw0-f46.google.com with SMTP id 15so692257pwi.19 for ; Sun, 06 Mar 2011 18:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:x-mailer:cc:subject; bh=dXE0CHDuPiUWbgnc0S7jwXWuJ6lrYiJSkQqMXqiPEaY=; b=mVv5nPuxI+zXeHYxRbXspEIeznCVEWlRayXqV99SysEbUJPUfAhGmOGjKFMJl5bMvK 7BPSwrC+KxcP2/1MbuGbpcss9lMM6OVjK1QP3ZZulexunrqdLg4yWjDMAFL3Z8uXexnY zvdAUjIyNFTq0xJsV2wQOY6fJT8NHWY45UgPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:mime-version:content-type:content-transfer-encoding:message-id :date:to:x-mailer:cc:subject; b=RIqrKtdFviTfy32ga9tYGL8typPMUQUL1s0A+PPtIzYy8WggcLqWIGegIj6vsizvkZ L6zXIvrPBWdjXW2jbiCb6Zu1Uf2+4TEpqbxAYWDWC9AmpVjwCX/nTCt+LnNhGkBn8xyn IV7u1DjYILlnUvm0HgGQaJ+JkMv/Yl8qGNV3Q= Received: by 10.142.153.14 with SMTP id a14mr2748638wfe.359.1299464036010; Sun, 06 Mar 2011 18:13:56 -0800 (PST) Received: from bodhi ([117.197.194.30]) by mx.google.com with ESMTPS id o11sm3659057wfa.12.2011.03.06.18.13.53 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Mar 2011 18:13:55 -0800 (PST) From: Sujith MIME-Version: 1.0 Message-ID: <19828.16219.455263.765424@gargle.gargle.HOWL> Date: Mon, 7 Mar 2011 07:43:47 +0530 To: linux-wireless@vger.kernel.org X-Mailer: VM 8.1.1 under 23.2.1 (x86_64-unknown-linux-gnu) CC: ath9k-devel@venema.h4ckr.net Subject: [RFC 11/34] ath9k_htc: Fix RX length check Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 07 Mar 2011 02:13:59 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index a62495d..7cd3e4e 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c @@ -525,8 +525,9 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, int last_rssi = ATH_RSSI_DUMMY_MARKER; __le16 fc; - if (skb->len <= HTC_RX_FRAME_HEADER_SIZE) { - ath_err(common, "Corrupted RX frame, dropping\n"); + if (skb->len < HTC_RX_FRAME_HEADER_SIZE) { + ath_err(common, "Corrupted RX frame, dropping (len: %d)\n", + skb->len); goto rx_next; }