Skip to content

Commit

Permalink
block: removes dynamic allocation on stack
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Philip J Kelleher authored and axboe committed Mar 26, 2013
1 parent f2fc7d0 commit d8d595d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/block/rsxx/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d8d595d

Please sign in to comment.