diff options
author | Dan Carpenter <error27@gmail.com> | 2010-08-23 06:28:15 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-23 06:28:15 -0400 |
commit | 4ee69851cd4880f574d22f5ce08bec35b01c94e3 (patch) | |
tree | 1e249690aeb31a8d30e22e7db26eb9331a88c08b /drivers/block | |
parent | 6d6ac1c1a3d4f95953aa3b085e8f16692d3a7179 (diff) |
cciss: handle allocation failure
If kmalloc() fails then cleanup and return failure (-1).
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/cciss.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index ce1a75df5902..7191c16954d2 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -4718,6 +4718,9 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
4718 | h->scatter_list = kmalloc(h->max_commands * | 4718 | h->scatter_list = kmalloc(h->max_commands * |
4719 | sizeof(struct scatterlist *), | 4719 | sizeof(struct scatterlist *), |
4720 | GFP_KERNEL); | 4720 | GFP_KERNEL); |
4721 | if (!h->scatter_list) | ||
4722 | goto clean4; | ||
4723 | |||
4721 | for (k = 0; k < h->nr_cmds; k++) { | 4724 | for (k = 0; k < h->nr_cmds; k++) { |
4722 | h->scatter_list[k] = kmalloc(sizeof(struct scatterlist) * | 4725 | h->scatter_list[k] = kmalloc(sizeof(struct scatterlist) * |
4723 | h->maxsgentries, | 4726 | h->maxsgentries, |