mirror of https://gitee.com/openkylin/linux.git
net: brcm80211: Deletion of unnecessary checks before two function calls
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>
This commit is contained in:
parent
9a638ddfb0
commit
ac96ce83ff
|
@ -262,7 +262,6 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev));
|
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);
|
device_release_driver(fwctx->dev);
|
||||||
kfree(fwctx);
|
kfree(fwctx);
|
||||||
|
|
|
@ -518,7 +518,6 @@ static int brcmf_msgbuf_query_dcmd(struct brcmf_pub *drvr, int ifidx,
|
||||||
memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ?
|
memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ?
|
||||||
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;
|
return msgbuf->ioctl_resp_status;
|
||||||
|
|
|
@ -1009,7 +1009,6 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
|
||||||
if (txh)
|
if (txh)
|
||||||
trace_brcms_txdesc(&wlc->hw->d11core->dev, txh,
|
trace_brcms_txdesc(&wlc->hw->d11core->dev, txh,
|
||||||
sizeof(*txh));
|
sizeof(*txh));
|
||||||
if (p)
|
|
||||||
brcmu_pkt_buf_free_skb(p);
|
brcmu_pkt_buf_free_skb(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue