summaryrefslogtreecommitdiffstats
path: root/drivers/block/rsxx/dma.c
diff options
context:
space:
mode:
authorPhilip J Kelleher <pjk1939@linux.vnet.ibm.com>2013-03-26 17:03:07 +0100
committerJens Axboe <axboe@kernel.dk>2013-03-26 21:48:11 +0100
commit4dcaf47258d59010802bd0eda933f69ee7d98cc7 (patch)
treeb1787a3dcdd4a1ce5d59d0ba0ccff811fc30f268 /drivers/block/rsxx/dma.c
parentblock: removes dynamic allocation on stack (diff)
downloadlinux-4dcaf47258d59010802bd0eda933f69ee7d98cc7.tar.xz
linux-4dcaf47258d59010802bd0eda933f69ee7d98cc7.zip
rsxx: enable error return of rsxx_eeh_save_issued_dmas()
Commit d8d595df introduced a bug where we did not check for a NULL return from kmalloc(). Make rsxx_eeh_save_issued_dmas() return an error for that case, and make the callers handle that. Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/rsxx/dma.c')
-rw-r--r--drivers/block/rsxx/dma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/rsxx/dma.c b/drivers/block/rsxx/dma.c
index 95047e111a33..7594c6ddc181 100644
--- a/drivers/block/rsxx/dma.c
+++ b/drivers/block/rsxx/dma.c
@@ -980,7 +980,7 @@ void rsxx_dma_destroy(struct rsxx_cardinfo *card)
}
}
-void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
+int rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
{
int i;
int j;
@@ -990,6 +990,8 @@ void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
issued_dmas = kzalloc(sizeof(*issued_dmas) * card->n_targets,
GFP_KERNEL);
+ if (!issued_dmas)
+ return -ENOMEM;
for (i = 0; i < card->n_targets; i++) {
INIT_LIST_HEAD(&issued_dmas[i]);
@@ -1030,6 +1032,8 @@ void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
}
kfree(issued_dmas);
+
+ return 0;
}
void rsxx_eeh_cancel_dmas(struct rsxx_cardinfo *card)