提交 d8d595df 编写于 作者: P Philip J Kelleher 提交者: Jens Axboe

block: removes dynamic allocation on stack

This patch removes dynamic allocation on the stack error.
Signed-off-by: NPhilip J Kelleher <pjk1939@linux.vnet.ibm.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 f2fc7d0e
...@@ -986,7 +986,10 @@ void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card) ...@@ -986,7 +986,10 @@ void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
int j; int j;
int cnt; int cnt;
struct rsxx_dma *dma; 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++) { for (i = 0; i < card->n_targets; i++) {
INIT_LIST_HEAD(&issued_dmas[i]); INIT_LIST_HEAD(&issued_dmas[i]);
...@@ -1025,6 +1028,8 @@ void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card) ...@@ -1025,6 +1028,8 @@ void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
} }
spin_unlock(&card->ctrl[i].queue_lock); spin_unlock(&card->ctrl[i].queue_lock);
} }
kfree(issued_dmas);
} }
void rsxx_eeh_cancel_dmas(struct rsxx_cardinfo *card) void rsxx_eeh_cancel_dmas(struct rsxx_cardinfo *card)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册