Skip to content

Commit

Permalink
net: brcm80211: Deletion of unnecessary checks before two function calls
Browse files Browse the repository at this point in the history
The functions brcmu_pkt_buf_free_skb() and release_firmware() test whether
their argument is NULL and then return immediately. Thus the test around
the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Markus Elfring authored and John W. Linville committed Nov 20, 2014
1 parent 9a638dd commit ac96ce8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions drivers/net/wireless/brcm80211/brcmfmac/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)

fail:
brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev));
if (fwctx->code)
release_firmware(fwctx->code);
release_firmware(fwctx->code);
device_release_driver(fwctx->dev);
kfree(fwctx);
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,7 @@ static int brcmf_msgbuf_query_dcmd(struct brcmf_pub *drvr, int ifidx,
memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ?
len : msgbuf->ioctl_resp_ret_len);
}
if (skb)
brcmu_pkt_buf_free_skb(skb);
brcmu_pkt_buf_free_skb(skb);

return msgbuf->ioctl_resp_status;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/brcm80211/brcmsmac/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,8 +1009,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
if (txh)
trace_brcms_txdesc(&wlc->hw->d11core->dev, txh,
sizeof(*txh));
if (p)
brcmu_pkt_buf_free_skb(p);
brcmu_pkt_buf_free_skb(p);
}

if (dma && queue < NFIFO) {
Expand Down

0 comments on commit ac96ce8

Please sign in to comment.