]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
staging: brcm80211: bugfix for len==0 parameter in 3 fullmac functions
authorRoland Vossen <rvossen@broadcom.com>
Mon, 8 Aug 2011 13:57:46 +0000 (15:57 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 19:59:50 +0000 (12:59 -0700)
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 <error27@gmail.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
drivers/staging/brcm80211/brcmfmac/dhd_common.c
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c

index 38bd9ba3096f4e002808b9eb9ae4d168e62ec964..e345af7918e28e37f433fca98d45172e76c58fe5 100644 (file)
@@ -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 */
index fdec4683c422a1236b1e29c3ec48ba45df568ac6..1e757b73b80797471b9ed7509f514eb7a35c6c58 100644 (file)
@@ -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 */
index 7fa95b6213c544d9330fb4cfa099e9df463ac118..acad298567fc0d472c7f74c28c29e49f26045fd4 100644 (file)
@@ -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 */