* [PATCH] block: removes dynamic allocation on stack
@ 2013-03-25 22:10 Philip J. Kelleher
2013-03-26 1:22 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Philip J. Kelleher @ 2013-03-25 22:10 UTC (permalink / raw)
To: axboe; +Cc: linux-kernel, klebers
From: Philip J Kelleher <pjk1939@linux.vnet.ibm.com>
This patch removes dynamic allocation on the stack error.
Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com>
-------------------------------------------------------------------------------
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] block: removes dynamic allocation on stack
2013-03-25 22:10 [PATCH] block: removes dynamic allocation on stack Philip J. Kelleher
@ 2013-03-26 1:22 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2013-03-26 1:22 UTC (permalink / raw)
To: Philip J. Kelleher; +Cc: linux-kernel, klebers
On Mon, Mar 25 2013, Philip J. Kelleher wrote:
> From: Philip J Kelleher <pjk1939@linux.vnet.ibm.com>
>
> This patch removes dynamic allocation on the stack error.
>
> Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com>
> -------------------------------------------------------------------------------
>
>
> 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;
Ahem - thanks, applied :-)
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-26 1:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25 22:10 [PATCH] block: removes dynamic allocation on stack Philip J. Kelleher
2013-03-26 1:22 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox