diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-01-11 16:40:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-11 16:40:56 -0500 |
commit | 7408187d223f63d46a13b6a35b8f96b032c2f623 (patch) | |
tree | 425a459f760295de488f57e3f97b034aaa76a78d /drivers/media/dvb/dvb-usb/dvb-usb-urb.c | |
parent | 0b3af1b6df82cfdb54ae294ed860263011fa0408 (diff) |
V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc
Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb-usb-urb.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-urb.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c index 36b7048c02d2..ee821974dc60 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c | |||
@@ -175,15 +175,13 @@ static int dvb_usb_allocate_stream_buffers(struct dvb_usb_device *d, int num, un | |||
175 | 175 | ||
176 | deb_mem("all in all I will use %lu bytes for streaming\n",num*size); | 176 | deb_mem("all in all I will use %lu bytes for streaming\n",num*size); |
177 | 177 | ||
178 | if ((d->buf_list = kmalloc(num*sizeof(u8 *), GFP_ATOMIC)) == NULL) | 178 | if ((d->buf_list = kcalloc(num, sizeof(u8 *), GFP_ATOMIC)) == NULL) |
179 | return -ENOMEM; | 179 | return -ENOMEM; |
180 | 180 | ||
181 | if ((d->dma_addr = kmalloc(num*sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) { | 181 | if ((d->dma_addr = kcalloc(num, sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) { |
182 | kfree(d->buf_list); | 182 | kfree(d->buf_list); |
183 | return -ENOMEM; | 183 | return -ENOMEM; |
184 | } | 184 | } |
185 | memset(d->buf_list,0,num*sizeof(u8 *)); | ||
186 | memset(d->dma_addr,0,num*sizeof(dma_addr_t)); | ||
187 | 185 | ||
188 | d->state |= DVB_USB_STATE_URB_BUF; | 186 | d->state |= DVB_USB_STATE_URB_BUF; |
189 | 187 | ||
@@ -285,10 +283,9 @@ int dvb_usb_urb_init(struct dvb_usb_device *d) | |||
285 | usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint)); | 283 | usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint)); |
286 | 284 | ||
287 | /* allocate the array for the data transfer URBs */ | 285 | /* allocate the array for the data transfer URBs */ |
288 | d->urb_list = kmalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL); | 286 | d->urb_list = kzalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL); |
289 | if (d->urb_list == NULL) | 287 | if (d->urb_list == NULL) |
290 | return -ENOMEM; | 288 | return -ENOMEM; |
291 | memset(d->urb_list,0,d->props.urb.count * sizeof(struct urb *)); | ||
292 | d->state |= DVB_USB_STATE_URB_LIST; | 289 | d->state |= DVB_USB_STATE_URB_LIST; |
293 | 290 | ||
294 | switch (d->props.urb.type) { | 291 | switch (d->props.urb.type) { |