cfg80211: handle failed skb allocation
[cascardo/linux.git] / drivers / staging / rdma / hfi1 / init.c
index cfcdc16..502b7cf 100644 (file)
@@ -422,9 +422,10 @@ static enum hrtimer_restart cca_timer_fn(struct hrtimer *t)
        struct cca_timer *cca_timer;
        struct hfi1_pportdata *ppd;
        int sl;
-       u16 ccti, ccti_timer, ccti_min;
+       u16 ccti_timer, ccti_min;
        struct cc_state *cc_state;
        unsigned long flags;
+       enum hrtimer_restart ret = HRTIMER_NORESTART;
 
        cca_timer = container_of(t, struct cca_timer, hrtimer);
        ppd = cca_timer->ppd;
@@ -450,24 +451,21 @@ static enum hrtimer_restart cca_timer_fn(struct hrtimer *t)
 
        spin_lock_irqsave(&ppd->cca_timer_lock, flags);
 
-       ccti = cca_timer->ccti;
-
-       if (ccti > ccti_min) {
+       if (cca_timer->ccti > ccti_min) {
                cca_timer->ccti--;
                set_link_ipg(ppd);
        }
 
-       spin_unlock_irqrestore(&ppd->cca_timer_lock, flags);
-
-       rcu_read_unlock();
-
-       if (ccti > ccti_min) {
+       if (cca_timer->ccti > ccti_min) {
                unsigned long nsec = 1024 * ccti_timer;
                /* ccti_timer is in units of 1.024 usec */
                hrtimer_forward_now(t, ns_to_ktime(nsec));
-               return HRTIMER_RESTART;
+               ret = HRTIMER_RESTART;
        }
-       return HRTIMER_NORESTART;
+
+       spin_unlock_irqrestore(&ppd->cca_timer_lock, flags);
+       rcu_read_unlock();
+       return ret;
 }
 
 /*
@@ -496,7 +494,6 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd,
        INIT_WORK(&ppd->link_vc_work, handle_verify_cap);
        INIT_WORK(&ppd->link_up_work, handle_link_up);
        INIT_WORK(&ppd->link_down_work, handle_link_down);
-       INIT_WORK(&ppd->dc_host_req_work, handle_8051_request);
        INIT_WORK(&ppd->freeze_work, handle_freeze);
        INIT_WORK(&ppd->link_downgrade_work, handle_link_downgrade);
        INIT_WORK(&ppd->sma_message_work, handle_sma_message);
@@ -1007,7 +1004,7 @@ void hfi1_free_devdata(struct hfi1_devdata *dd)
        free_percpu(dd->rcv_limit);
        hfi1_dev_affinity_free(dd);
        free_percpu(dd->send_schedule);
-       ib_dealloc_device(&dd->verbs_dev.rdi.ibdev);
+       rvt_dealloc_device(&dd->verbs_dev.rdi);
 }
 
 /*
@@ -1110,7 +1107,7 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra)
 bail:
        if (!list_empty(&dd->list))
                list_del_init(&dd->list);
-       ib_dealloc_device(&dd->verbs_dev.rdi.ibdev);
+       rvt_dealloc_device(&dd->verbs_dev.rdi);
        return ERR_PTR(ret);
 }