diff options
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) { |