From patchwork Mon Aug 8 13:57:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 1044482 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p78DxPAW008345 for ; Mon, 8 Aug 2011 13:59:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752268Ab1HHN7X (ORCPT ); Mon, 8 Aug 2011 09:59:23 -0400 Received: from mms3.broadcom.com ([216.31.210.19]:3078 "EHLO MMS3.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023Ab1HHN7W (ORCPT ); Mon, 8 Aug 2011 09:59:22 -0400 Received: from [10.9.200.131] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Mon, 08 Aug 2011 07:04:16 -0700 X-Server-Uuid: B55A25B1-5D7D-41F8-BC53-C57E7AD3C201 Received: from mail-irva-13.broadcom.com (10.11.16.103) by IRVEXCHHUB01.corp.ad.broadcom.com (10.9.200.131) with Microsoft SMTP Server id 8.2.247.2; Mon, 8 Aug 2011 06:59:10 -0700 Received: from mail-sj1-12.sj.broadcom.com (mail-sj1-12.sj.broadcom.com [10.17.16.106]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 10DCF74D04; Mon, 8 Aug 2011 06:59:10 -0700 (PDT) Received: from arend-laptop (unknown [10.176.68.34]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 6775720504; Mon, 8 Aug 2011 06:59:08 -0700 (PDT) Received: from arend by arend-laptop with local (Exim 4.74) ( envelope-from ) id 1QqQMF-0004NY-9F; Mon, 08 Aug 2011 15:59:07 +0200 From: "Arend van Spriel" To: gregkh@suse.de cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org, "Roland Vossen" , "Arend van Spriel" Subject: [PATCHv2 02/82] staging: brcm80211: bugfix for len==0 parameter in 3 fullmac functions Date: Mon, 8 Aug 2011 15:57:46 +0200 Message-ID: <1312811946-16713-3-git-send-email-arend@broadcom.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1312811946-16713-1-git-send-email-arend@broadcom.com> References: <1312811946-16713-1-git-send-email-arend@broadcom.com> MIME-Version: 1.0 X-WSS-ID: 6221336A3KO3788473-01-01 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, 08 Aug 2011 13:59:26 +0000 (UTC) From: Roland Vossen Three functions use the same method to check incoming parameters. The 'len' parameter can be equal to 0 in case of a 'set' operation. Currently these functions return an error code under that condition, which is incorrect. The problem was introduced in recent patches in which asserts were removed from the fullmac. Despite this being a bug, my regression testing has not shown any problems. Reported-by: Dan Carpenter Signed-off-by: Roland Vossen Reviewed-by: Arend van Spriel Reviewed-by: Franky Lin Signed-off-by: Arend van Spriel --- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 2 +- drivers/staging/brcm80211/brcmfmac/dhd_common.c | 2 +- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c index 38bd9ba..e345af7 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c @@ -407,7 +407,7 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name, bool bool_val; u32 actionid; - if (name == NULL || len <= 0) + if (name == NULL || len < 0) return -EINVAL; /* Set does not take qualifiers */ diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c index fdec468..1e757b7 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c @@ -311,7 +311,7 @@ brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name, BRCMF_TRACE(("%s: Enter\n", __func__)); - if (name == NULL || len <= 0) + if (name == NULL || len < 0) return -EINVAL; /* Set does not take qualifiers */ diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c index ca6e60f..126a7ce 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c @@ -3123,7 +3123,7 @@ brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name, BRCMF_TRACE(("%s: Enter\n", __func__)); - if (name == NULL || len <= 0) + if (name == NULL || len < 0) return -EINVAL; /* Set does not take qualifiers */