summaryrefslogtreecommitdiff
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 98789a5297f2..0000913f7efc 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -355,8 +355,7 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd,
if (rq->bio != rq->biotail) {
- bvec = kmalloc_array(nr_bvec, sizeof(struct bio_vec),
- GFP_NOIO);
+ bvec = kmalloc_objs(struct bio_vec, nr_bvec, GFP_NOIO);
if (!bvec)
return -EIO;
cmd->bvec = bvec;
@@ -823,7 +822,7 @@ static void loop_queue_work(struct loop_device *lo, struct loop_cmd *cmd)
if (worker)
goto queue_work;
- worker = kzalloc(sizeof(struct loop_worker), GFP_NOWAIT);
+ worker = kzalloc_obj(struct loop_worker, GFP_NOWAIT);
/*
* In the event we cannot allocate a worker, just queue on the
* rootcg worker and issue the I/O as the rootcg
@@ -2010,7 +2009,7 @@ static int loop_add(int i)
int err;
err = -ENOMEM;
- lo = kzalloc(sizeof(*lo), GFP_KERNEL);
+ lo = kzalloc_obj(*lo);
if (!lo)
goto out;
lo->worker_tree = RB_ROOT;