Skip to content

Commit

Permalink
staging: brcm80211: bugfix for len==0 parameter in 3 fullmac functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent a9f81a9 commit 2c1599c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 2c1599c

Please sign in to comment.