diff options
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r-- | drivers/block/pktcdvd.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 109db859112a..b443fe5eebe4 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -112,10 +112,9 @@ static struct bio *pkt_bio_alloc(int nr_iovecs) | |||
112 | goto no_bio; | 112 | goto no_bio; |
113 | bio_init(bio); | 113 | bio_init(bio); |
114 | 114 | ||
115 | bvl = kmalloc(nr_iovecs * sizeof(struct bio_vec), GFP_KERNEL); | 115 | bvl = kcalloc(nr_iovecs, sizeof(struct bio_vec), GFP_KERNEL); |
116 | if (!bvl) | 116 | if (!bvl) |
117 | goto no_bvl; | 117 | goto no_bvl; |
118 | memset(bvl, 0, nr_iovecs * sizeof(struct bio_vec)); | ||
119 | 118 | ||
120 | bio->bi_max_vecs = nr_iovecs; | 119 | bio->bi_max_vecs = nr_iovecs; |
121 | bio->bi_io_vec = bvl; | 120 | bio->bi_io_vec = bvl; |
@@ -137,10 +136,9 @@ static struct packet_data *pkt_alloc_packet_data(void) | |||
137 | int i; | 136 | int i; |
138 | struct packet_data *pkt; | 137 | struct packet_data *pkt; |
139 | 138 | ||
140 | pkt = kmalloc(sizeof(struct packet_data), GFP_KERNEL); | 139 | pkt = kzalloc(sizeof(struct packet_data), GFP_KERNEL); |
141 | if (!pkt) | 140 | if (!pkt) |
142 | goto no_pkt; | 141 | goto no_pkt; |
143 | memset(pkt, 0, sizeof(struct packet_data)); | ||
144 | 142 | ||
145 | pkt->w_bio = pkt_bio_alloc(PACKET_MAX_SIZE); | 143 | pkt->w_bio = pkt_bio_alloc(PACKET_MAX_SIZE); |
146 | if (!pkt->w_bio) | 144 | if (!pkt->w_bio) |
@@ -2492,10 +2490,9 @@ static int pkt_setup_dev(struct pkt_ctrl_command *ctrl_cmd) | |||
2492 | return -EBUSY; | 2490 | return -EBUSY; |
2493 | } | 2491 | } |
2494 | 2492 | ||
2495 | pd = kmalloc(sizeof(struct pktcdvd_device), GFP_KERNEL); | 2493 | pd = kzalloc(sizeof(struct pktcdvd_device), GFP_KERNEL); |
2496 | if (!pd) | 2494 | if (!pd) |
2497 | return ret; | 2495 | return ret; |
2498 | memset(pd, 0, sizeof(struct pktcdvd_device)); | ||
2499 | 2496 | ||
2500 | pd->rb_pool = mempool_create(PKT_RB_POOL_SIZE, pkt_rb_alloc, pkt_rb_free, NULL); | 2497 | pd->rb_pool = mempool_create(PKT_RB_POOL_SIZE, pkt_rb_alloc, pkt_rb_free, NULL); |
2501 | if (!pd->rb_pool) | 2498 | if (!pd->rb_pool) |