aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/wlan-ng/hfa384x_usb.c28
-rw-r--r--drivers/staging/wlan-ng/p80211conv.c14
-rw-r--r--drivers/staging/wlan-ng/p80211netdev.c3
-rw-r--r--drivers/staging/wlan-ng/p80211wext.c8
4 files changed, 28 insertions, 25 deletions
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 730d085c3f87..d3a85f249e96 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -1909,18 +1909,19 @@ int hfa384x_drvr_flashdl_enable(hfa384x_t *hw)
1909 return -EINVAL; 1909 return -EINVAL;
1910 1910
1911 /* Retrieve the buffer loc&size and timeout */ 1911 /* Retrieve the buffer loc&size and timeout */
1912 if ((result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER, 1912 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER,
1913 &(hw->bufinfo), 1913 &(hw->bufinfo), sizeof(hw->bufinfo));
1914 sizeof(hw->bufinfo)))) { 1914 if (result)
1915 return result; 1915 return result;
1916 } 1916
1917 hw->bufinfo.page = le16_to_cpu(hw->bufinfo.page); 1917 hw->bufinfo.page = le16_to_cpu(hw->bufinfo.page);
1918 hw->bufinfo.offset = le16_to_cpu(hw->bufinfo.offset); 1918 hw->bufinfo.offset = le16_to_cpu(hw->bufinfo.offset);
1919 hw->bufinfo.len = le16_to_cpu(hw->bufinfo.len); 1919 hw->bufinfo.len = le16_to_cpu(hw->bufinfo.len);
1920 if ((result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME, 1920 result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME,
1921 &(hw->dltimeout)))) { 1921 &(hw->dltimeout));
1922 if (result)
1922 return result; 1923 return result;
1923 } 1924
1924 hw->dltimeout = le16_to_cpu(hw->dltimeout); 1925 hw->dltimeout = le16_to_cpu(hw->dltimeout);
1925 1926
1926 pr_debug("flashdl_enable\n"); 1927 pr_debug("flashdl_enable\n");
@@ -3071,9 +3072,9 @@ static void hfa384x_usbctlxq_run(hfa384x_t *hw)
3071 hfa384x_ctlxout_callback, hw); 3072 hfa384x_ctlxout_callback, hw);
3072 hw->ctlx_urb.transfer_flags |= USB_QUEUE_BULK; 3073 hw->ctlx_urb.transfer_flags |= USB_QUEUE_BULK;
3073 3074
3074 /* Now submit the URB and update the CTLX's state 3075 /* Now submit the URB and update the CTLX's state */
3075 */ 3076 result = SUBMIT_URB(&hw->ctlx_urb, GFP_ATOMIC);
3076 if ((result = SUBMIT_URB(&hw->ctlx_urb, GFP_ATOMIC)) == 0) { 3077 if (result == 0) {
3077 /* This CTLX is now running on the active queue */ 3078 /* This CTLX is now running on the active queue */
3078 head->state = CTLX_REQ_SUBMITTED; 3079 head->state = CTLX_REQ_SUBMITTED;
3079 3080
@@ -3599,7 +3600,8 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
3599 skblen - sizeof(p80211_caphdr_t)); 3600 skblen - sizeof(p80211_caphdr_t));
3600 } 3601 }
3601 3602
3602 if ((skb = dev_alloc_skb(skblen)) == NULL) { 3603 skb = dev_alloc_skb(skblen);
3604 if (skb == NULL) {
3603 printk(KERN_ERR 3605 printk(KERN_ERR
3604 "alloc_skb failed trying to allocate %d bytes\n", 3606 "alloc_skb failed trying to allocate %d bytes\n",
3605 skblen); 3607 skblen);
@@ -3870,9 +3872,9 @@ retry:
3870 3872
3871delresp: 3873delresp:
3872 if (delete_resptimer) { 3874 if (delete_resptimer) {
3873 if ((timer_ok = del_timer(&hw->resptimer)) != 0) { 3875 timer_ok = del_timer(&hw->resptimer);
3876 if (timer_ok != 0)
3874 hw->resp_timer_done = 1; 3877 hw->resp_timer_done = 1;
3875 }
3876 } 3878 }
3877 3879
3878 spin_unlock_irqrestore(&hw->ctlxq.lock, flags); 3880 spin_unlock_irqrestore(&hw->ctlxq.lock, flags);
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index 5952c671073f..3ba5eabdb583 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -207,11 +207,10 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
207 207
208 p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC); 208 p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC);
209 209
210 if ((foo = wep_encrypt(wlandev, skb->data, p80211_wep->data, 210 foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
211 skb->len, 211 skb->len, (wlandev->hostwep &HOSTWEP_DEFAULTKEY_MASK),
212 (wlandev->hostwep & 212 p80211_wep->iv, p80211_wep->icv);
213 HOSTWEP_DEFAULTKEY_MASK), 213 if (foo) {
214 p80211_wep->iv, p80211_wep->icv))) {
215 printk(KERN_WARNING 214 printk(KERN_WARNING
216 "Host en-WEP failed, dropping frame (%d).\n", 215 "Host en-WEP failed, dropping frame (%d).\n",
217 foo); 216 foo);
@@ -323,11 +322,12 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
323 skb->len); 322 skb->len);
324 return 1; 323 return 1;
325 } 324 }
326 if ((foo = wep_decrypt(wlandev, skb->data + payload_offset + 4, 325 foo = wep_decrypt(wlandev, skb->data + payload_offset + 4,
327 payload_length - 8, -1, 326 payload_length - 8, -1,
328 skb->data + payload_offset, 327 skb->data + payload_offset,
329 skb->data + payload_offset + 328 skb->data + payload_offset +
330 payload_length - 4))) { 329 payload_length - 4);
330 if (foo) {
331 /* de-wep failed, drop skb. */ 331 /* de-wep failed, drop skb. */
332 pr_debug("Host de-WEP failed, dropping frame (%d).\n", 332 pr_debug("Host de-WEP failed, dropping frame (%d).\n",
333 foo); 333 foo);
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
index e27d72cf5714..763ab1187a1c 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -586,7 +586,8 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
586 } 586 }
587 587
588 /* Allocate a buf of size req->len */ 588 /* Allocate a buf of size req->len */
589 if ((msgbuf = kmalloc(req->len, GFP_KERNEL))) { 589 msgbuf = kmalloc(req->len, GFP_KERNEL);
590 if (msgbuf) {
590 if (copy_from_user(msgbuf, (void __user *)req->data, req->len)) 591 if (copy_from_user(msgbuf, (void __user *)req->data, req->len))
591 result = -EFAULT; 592 result = -EFAULT;
592 else 593 else
diff --git a/drivers/staging/wlan-ng/p80211wext.c b/drivers/staging/wlan-ng/p80211wext.c
index 040c9e3e1d51..108a8060d1f5 100644
--- a/drivers/staging/wlan-ng/p80211wext.c
+++ b/drivers/staging/wlan-ng/p80211wext.c
@@ -549,14 +549,14 @@ static int p80211wext_siwencode(netdevice_t *dev,
549 } 549 }
550 550
551 /* Check the Key index first. */ 551 /* Check the Key index first. */
552 if ((i = (erq->flags & IW_ENCODE_INDEX))) { 552 i = (erq->flags & IW_ENCODE_INDEX);
553 553 if (i) {
554 if ((i < 1) || (i > NUM_WEPKEYS)) { 554 if ((i < 1) || (i > NUM_WEPKEYS)) {
555 err = -EINVAL; 555 err = -EINVAL;
556 goto exit; 556 goto exit;
557 } else 557 } else {
558 i--; 558 i--;
559 559 }
560 /* Set current key number only if no keys are given */ 560 /* Set current key number only if no keys are given */
561 if (erq->flags & IW_ENCODE_NOKEY) { 561 if (erq->flags & IW_ENCODE_NOKEY) {
562 result = 562 result =