aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-02-24 01:22:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-27 14:06:41 -0500
commitd4ca00992ce0809e8cfdc452aa3f972e3be72654 (patch)
tree9c45a73066a27f6f96f3b520c4ac182cca0d7c83
parent06d9b6ac75379297c6a47ee8b8d0fe8b5cedcd39 (diff)
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: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/usb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index 934ed782620c..7c54d1db4a44 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -482,7 +482,7 @@ static void brcmf_usb_free_q(struct list_head *q, bool pending)
482 struct brcmf_usbreq *req, *next; 482 struct brcmf_usbreq *req, *next;
483 int i = 0; 483 int i = 0;
484 list_for_each_entry_safe(req, next, q, list) { 484 list_for_each_entry_safe(req, next, q, list) {
485 if (!req || !req->urb) { 485 if (!req->urb) {
486 brcmf_dbg(ERROR, "bad req\n"); 486 brcmf_dbg(ERROR, "bad req\n");
487 break; 487 break;
488 } 488 }
@@ -712,12 +712,12 @@ static int brcmf_usb_up(struct device *dev)
712 struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(dev); 712 struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(dev);
713 u16 ifnum; 713 u16 ifnum;
714 714
715 if (devinfo->bus_pub.state == BCMFMAC_USB_STATE_UP)
716 return 0;
717
718 if (devinfo == NULL) 715 if (devinfo == NULL)
719 return -EINVAL; 716 return -EINVAL;
720 717
718 if (devinfo->bus_pub.state == BCMFMAC_USB_STATE_UP)
719 return 0;
720
721 /* If the USB/HSIC bus in sleep state, wake it up */ 721 /* If the USB/HSIC bus in sleep state, wake it up */
722 if (devinfo->suspend_state == USBOS_SUSPEND_STATE_SUSPENDED) { 722 if (devinfo->suspend_state == USBOS_SUSPEND_STATE_SUSPENDED) {
723 if (brcmf_usb_pnp(devinfo, BCMFMAC_USB_PNP_RESUME) != 0) { 723 if (brcmf_usb_pnp(devinfo, BCMFMAC_USB_PNP_RESUME) != 0) {