提交 d4ca0099 编写于 作者: D Dan Carpenter 提交者: John W. Linville

brcm80211: fmac: fix a couple checking after dereference bugs

There were two dereferencing before checking for NULL static checker
complaints in this new file.  The list cursor is never NULL so that
check can be removed.  I moved the other dereference after the check.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 06d9b6ac
......@@ -482,7 +482,7 @@ static void brcmf_usb_free_q(struct list_head *q, bool pending)
struct brcmf_usbreq *req, *next;
int i = 0;
list_for_each_entry_safe(req, next, q, list) {
if (!req || !req->urb) {
if (!req->urb) {
brcmf_dbg(ERROR, "bad req\n");
break;
}
......@@ -712,12 +712,12 @@ static int brcmf_usb_up(struct device *dev)
struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(dev);
u16 ifnum;
if (devinfo->bus_pub.state == BCMFMAC_USB_STATE_UP)
return 0;
if (devinfo == NULL)
return -EINVAL;
if (devinfo->bus_pub.state == BCMFMAC_USB_STATE_UP)
return 0;
/* If the USB/HSIC bus in sleep state, wake it up */
if (devinfo->suspend_state == USBOS_SUSPEND_STATE_SUSPENDED) {
if (brcmf_usb_pnp(devinfo, BCMFMAC_USB_PNP_RESUME) != 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册