Skip to contentSkip to conversation

net: wireless: add brcm80211 drivers

DISCUSSION Dan Carpenter 2 participants 2 messages Aug 5, 2012 – Aug 6, 2012

lore
Share & tools
lore
#0 lore raw

Hi Arend,

The patch 5b435de0d786: "net: wireless: add brcm80211 drivers" from Oct 5, 2011, leads to the following warning:
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c:1699 brcmf_sdbrcm_readframes()
warn: is it ok to set 'rxseq' to -1?

  1697                          cnt = brcmf_sdbrcm_rxglom(bus, rxseq);
  1698                          brcmf_dbg(GLOM, "rxglom returned %d\n", cnt);
  1699                          rxseq += cnt - 1;
  1700                          rxleft = (rxleft > cnt) ? (rxleft - cnt) : 1;
  1701                          continue;

This isn't a warning, it's just one of the things I audit. brcmf_sdbrcm_rxglom() can return 0 so it's weird that we do "rxseq += 0 - 1;" Was that intended?

regards,
dan carpenter

#1 lore raw
Quoted 13 lines · Dan Carpenter

Hi Arend,

The patch 5b435de0d786: "net: wireless: add brcm80211 drivers" from Oct 5, 2011, leads to the following warning:
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c:1699 brcmf_sdbrcm_readframes()
warn: is it ok to set 'rxseq' to -1?

  1697                          cnt = brcmf_sdbrcm_rxglom(bus, rxseq);
  1698                          brcmf_dbg(GLOM, "rxglom returned %d\n", cnt);
  1699                          rxseq += cnt - 1;
  1700                          rxleft = (rxleft > cnt) ? (rxleft - cnt) : 1;
  1701                          continue;
Quoted 8 lines

This isn't a warning, it's just one of the things I audit. brcmf_sdbrcm_rxglom() can return 0 so it's weird that we do "rxseq += 0 - 1;" Was that intended?

regards,
dan carpenter

Thanks, Dan

Probably it was not intended, but we need a closer look. At rxseq should never be -1.

Gr. AvS