diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_cmd.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index 51b6959fc9d8..b7ee5e63af33 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -66,13 +66,13 @@ static sint _init_cmd_priv(struct cmd_priv *pcmdpriv) pcmdpriv->cmd_seq = 1; pcmdpriv->cmd_allocated_buf = kmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ, GFP_ATOMIC); - if (pcmdpriv->cmd_allocated_buf == NULL) + if (!pcmdpriv->cmd_allocated_buf) return _FAIL; pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((addr_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ - 1)); pcmdpriv->rsp_allocated_buf = kmalloc(MAX_RSPSZ + 4, GFP_ATOMIC); - if (pcmdpriv->rsp_allocated_buf == NULL) + if (!pcmdpriv->rsp_allocated_buf) return _FAIL; pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((addr_t)(pcmdpriv->rsp_allocated_buf) & 3); @@ -88,7 +88,7 @@ static sint _init_evt_priv(struct evt_priv *pevtpriv) pevtpriv->event_seq = 0; pevtpriv->evt_allocated_buf = kmalloc(MAX_EVTSZ + 4, GFP_ATOMIC); - if (pevtpriv->evt_allocated_buf == NULL) + if (!pevtpriv->evt_allocated_buf) return _FAIL; pevtpriv->evt_buf = pevtpriv->evt_allocated_buf + 4 - ((addr_t)(pevtpriv->evt_allocated_buf) & 3); @@ -123,7 +123,7 @@ static sint _enqueue_cmd(struct __queue *queue, struct cmd_obj *obj) { unsigned long irqL; - if (obj == NULL) + if (!obj) return _SUCCESS; spin_lock_irqsave(&queue->lock, irqL); list_add_tail(&obj->list, &queue->queue); @@ -181,7 +181,7 @@ u32 r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj) unsigned long irqL; struct __queue *queue; - if (obj == NULL) + if (!obj) return _SUCCESS; if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag) return _FAIL; @@ -477,7 +477,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) } } psecnetwork = &psecuritypriv->sec_bss; - if (psecnetwork == NULL) { + if (!psecnetwork) { kfree(pcmd); return _FAIL; } @@ -884,16 +884,16 @@ void r8712_createbss_cmd_callback(struct _adapter *padapter, if (!psta) { psta = r8712_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress); - if (psta == NULL) + if (!psta) goto createbss_cmd_fail; } r8712_indicate_connect(padapter); } else { pwlan = _r8712_alloc_network(pmlmepriv); - if (pwlan == NULL) { + if (!pwlan) { pwlan = r8712_get_oldest_wlan_network( &pmlmepriv->scanned_queue); - if (pwlan == NULL) + if (!pwlan) goto createbss_cmd_fail; pwlan->last_scanned = jiffies; } else @@ -925,7 +925,7 @@ void r8712_setstaKey_cmdrsp_callback(struct _adapter *padapter, struct sta_info *psta = r8712_get_stainfo(pstapriv, psetstakey_rsp->addr); - if (psta == NULL) + if (!psta) goto exit; psta->aid = psta->mac_id = psetstakey_rsp->keyid; /*CAM_ID(CAM_ENTRY)*/ exit: @@ -945,7 +945,7 @@ void r8712_setassocsta_cmdrsp_callback(struct _adapter *padapter, struct sta_info *psta = r8712_get_stainfo(pstapriv, passocsta_parm->addr); - if (psta == NULL) + if (!psta) return; psta->aid = psta->mac_id = passocsta_rsp->cam_id; spin_lock_irqsave(&pmlmepriv->lock, irqL); |