Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
[linux-2.6-block.git] / drivers / infiniband / hw / hfi1 / sdma.c
index 61c130dbed109c2f810a4588e8dc17ebf3637e52..1f203309cf24bee6d5a67fead77cd0ab146ab3fe 100644 (file)
@@ -1275,13 +1275,15 @@ bail:
        return -ENOMEM;
 }
 
-/*
- * Clean up allocated memory.
- *
- * This routine is can be called regardless of the success of sdma_init()
+/**
+ * sdma_clean()  Clean up allocated memory
+ * @dd:          struct hfi1_devdata
+ * @num_engines: num sdma engines
  *
+ * This routine can be called regardless of the success of
+ * sdma_init()
  */
-static void sdma_clean(struct hfi1_devdata *dd, size_t num_engines)
+void sdma_clean(struct hfi1_devdata *dd, size_t num_engines)
 {
        size_t i;
        struct sdma_engine *sde;
@@ -1386,7 +1388,8 @@ int sdma_init(struct hfi1_devdata *dd, u8 port)
                    num_engines, descq_cnt);
 
        /* alloc memory for array of send engines */
-       dd->per_sdma = kcalloc(num_engines, sizeof(*dd->per_sdma), GFP_KERNEL);
+       dd->per_sdma = kcalloc_node(num_engines, sizeof(*dd->per_sdma),
+                                   GFP_KERNEL, dd->node);
        if (!dd->per_sdma)
                return ret;
 
@@ -1617,7 +1620,6 @@ void sdma_exit(struct hfi1_devdata *dd)
                 */
                sdma_finalput(&sde->state);
        }
-       sdma_clean(dd, dd->num_sdma);
 }
 
 /*