block: removes dynamic allocation on stack
authorPhilip J Kelleher <pjk1939@linux.vnet.ibm.com>
Tue, 26 Mar 2013 01:22:31 +0000 (19:22 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Mar 2013 01:22:31 +0000 (19:22 -0600)
This patch removes dynamic allocation on the stack error.

Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rsxx/dma.c

index d523e9c565788690420445e8b368a33d0d1f85db..95047e111a336bf96f6b05aef8462dcf55d310ef 100644 (file)
@@ -986,7 +986,10 @@ void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
        int j;
        int cnt;
        struct rsxx_dma *dma;
-       struct list_head issued_dmas[card->n_targets];
+       struct list_head *issued_dmas;
+
+       issued_dmas = kzalloc(sizeof(*issued_dmas) * card->n_targets,
+                             GFP_KERNEL);
 
        for (i = 0; i < card->n_targets; i++) {
                INIT_LIST_HEAD(&issued_dmas[i]);
@@ -1025,6 +1028,8 @@ void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
                }
                spin_unlock(&card->ctrl[i].queue_lock);
        }
+
+       kfree(issued_dmas);
 }
 
 void rsxx_eeh_cancel_dmas(struct rsxx_cardinfo *card)