[PATCH] block: removes dynamic allocation on stack

From: Philip J. Kelleher
Date: Mon Mar 25 2013 - 18:10:57 EST


From: Philip J Kelleher <pjk1939@xxxxxxxxxxxxxxxxxx>

This patch removes dynamic allocation on the stack error.

Signed-off-by: Philip J Kelleher <pjk1939@xxxxxxxxxxxxxxxxxx>
-------------------------------------------------------------------------------


diff -uprN -X linux-block/Documentation/dontdiff linux-block-vanilla/drivers/block/rsxx/dma.c linux-block/drivers/block/rsxx/dma.c
--- linux-block-vanilla/drivers/block/rsxx/dma.c 2013-03-25 14:44:40.898978713 -0500
+++ linux-block/drivers/block/rsxx/dma.c 2013-03-25 14:50:48.054969658 -0500
@@ -986,7 +986,10 @@ void rsxx_eeh_save_issued_dmas(struct rs
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 rs
}
spin_unlock(&card->ctrl[i].queue_lock);
}
+
+ kfree(issued_dmas);
}

void rsxx_eeh_cancel_dmas(struct rsxx_cardinfo *card)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/