diff options
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop.c | 6 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dvb-bt8xx.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_ca_en50221.c | 8 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dtt200u-fe.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-init.c | 6 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-urb.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp702x-fe.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp7045-fe.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/bcm3510.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/dib3000mb.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/dib3000mc.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/lgdt330x.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/mt352.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/nxt200x.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/pluto2/pluto2.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget-av.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/ttusb-dec/ttusb_dec.c | 4 |
20 files changed, 25 insertions, 56 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop.c b/drivers/media/dvb/b2c2/flexcop.c index 123ed96f6faa..56ba52470676 100644 --- a/drivers/media/dvb/b2c2/flexcop.c +++ b/drivers/media/dvb/b2c2/flexcop.c | |||
@@ -220,20 +220,18 @@ EXPORT_SYMBOL(flexcop_reset_block_300); | |||
220 | struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len) | 220 | struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len) |
221 | { | 221 | { |
222 | void *bus; | 222 | void *bus; |
223 | struct flexcop_device *fc = kmalloc(sizeof(struct flexcop_device), GFP_KERNEL); | 223 | struct flexcop_device *fc = kzalloc(sizeof(struct flexcop_device), GFP_KERNEL); |
224 | if (!fc) { | 224 | if (!fc) { |
225 | err("no memory"); | 225 | err("no memory"); |
226 | return NULL; | 226 | return NULL; |
227 | } | 227 | } |
228 | memset(fc, 0, sizeof(struct flexcop_device)); | ||
229 | 228 | ||
230 | bus = kmalloc(bus_specific_len, GFP_KERNEL); | 229 | bus = kzalloc(bus_specific_len, GFP_KERNEL); |
231 | if (!bus) { | 230 | if (!bus) { |
232 | err("no memory"); | 231 | err("no memory"); |
233 | kfree(fc); | 232 | kfree(fc); |
234 | return NULL; | 233 | return NULL; |
235 | } | 234 | } |
236 | memset(bus, 0, bus_specific_len); | ||
237 | 235 | ||
238 | fc->bus_specific = bus; | 236 | fc->bus_specific = bus; |
239 | 237 | ||
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index 01b4e0aac049..f65f64b00ff3 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -786,10 +786,9 @@ static int dvb_bt8xx_probe(struct device *dev) | |||
786 | struct pci_dev* bttv_pci_dev; | 786 | struct pci_dev* bttv_pci_dev; |
787 | int ret; | 787 | int ret; |
788 | 788 | ||
789 | if (!(card = kmalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL))) | 789 | if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL))) |
790 | return -ENOMEM; | 790 | return -ENOMEM; |
791 | 791 | ||
792 | memset(card, 0, sizeof(*card)); | ||
793 | init_MUTEX(&card->lock); | 792 | init_MUTEX(&card->lock); |
794 | card->bttv_nr = sub->core->nr; | 793 | card->bttv_nr = sub->core->nr; |
795 | strncpy(card->card_name, sub->core->name, sizeof(sub->core->name)); | 794 | strncpy(card->card_name, sub->core->name, sizeof(sub->core->name)); |
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index 4bb779aeff6a..00347a750681 100644 --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c | |||
@@ -1649,21 +1649,17 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, | |||
1649 | return -EINVAL; | 1649 | return -EINVAL; |
1650 | 1650 | ||
1651 | /* initialise the system data */ | 1651 | /* initialise the system data */ |
1652 | if ((ca = | 1652 | if ((ca = kzalloc(sizeof(struct dvb_ca_private), GFP_KERNEL)) == NULL) { |
1653 | (struct dvb_ca_private *) kmalloc(sizeof(struct dvb_ca_private), | ||
1654 | GFP_KERNEL)) == NULL) { | ||
1655 | ret = -ENOMEM; | 1653 | ret = -ENOMEM; |
1656 | goto error; | 1654 | goto error; |
1657 | } | 1655 | } |
1658 | memset(ca, 0, sizeof(struct dvb_ca_private)); | ||
1659 | ca->pub = pubca; | 1656 | ca->pub = pubca; |
1660 | ca->flags = flags; | 1657 | ca->flags = flags; |
1661 | ca->slot_count = slot_count; | 1658 | ca->slot_count = slot_count; |
1662 | if ((ca->slot_info = kmalloc(sizeof(struct dvb_ca_slot) * slot_count, GFP_KERNEL)) == NULL) { | 1659 | if ((ca->slot_info = kcalloc(slot_count, sizeof(struct dvb_ca_slot), GFP_KERNEL)) == NULL) { |
1663 | ret = -ENOMEM; | 1660 | ret = -ENOMEM; |
1664 | goto error; | 1661 | goto error; |
1665 | } | 1662 | } |
1666 | memset(ca->slot_info, 0, sizeof(struct dvb_ca_slot) * slot_count); | ||
1667 | init_waitqueue_head(&ca->wait_queue); | 1663 | init_waitqueue_head(&ca->wait_queue); |
1668 | ca->thread_pid = 0; | 1664 | ca->thread_pid = 0; |
1669 | init_waitqueue_head(&ca->thread_queue); | 1665 | init_waitqueue_head(&ca->thread_queue); |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 4a08c4ab6730..771f32d889e6 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -1024,13 +1024,12 @@ int dvb_register_frontend(struct dvb_adapter* dvb, | |||
1024 | if (down_interruptible (&frontend_mutex)) | 1024 | if (down_interruptible (&frontend_mutex)) |
1025 | return -ERESTARTSYS; | 1025 | return -ERESTARTSYS; |
1026 | 1026 | ||
1027 | fe->frontend_priv = kmalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL); | 1027 | fe->frontend_priv = kzalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL); |
1028 | if (fe->frontend_priv == NULL) { | 1028 | if (fe->frontend_priv == NULL) { |
1029 | up(&frontend_mutex); | 1029 | up(&frontend_mutex); |
1030 | return -ENOMEM; | 1030 | return -ENOMEM; |
1031 | } | 1031 | } |
1032 | fepriv = fe->frontend_priv; | 1032 | fepriv = fe->frontend_priv; |
1033 | memset(fe->frontend_priv, 0, sizeof(struct dvb_frontend_private)); | ||
1034 | 1033 | ||
1035 | init_MUTEX (&fepriv->sem); | 1034 | init_MUTEX (&fepriv->sem); |
1036 | init_waitqueue_head (&fepriv->wait_queue); | 1035 | init_waitqueue_head (&fepriv->wait_queue); |
diff --git a/drivers/media/dvb/dvb-usb/dtt200u-fe.c b/drivers/media/dvb/dvb-usb/dtt200u-fe.c index 0a94ec22aeb8..cd21ddbfd054 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u-fe.c +++ b/drivers/media/dvb/dvb-usb/dtt200u-fe.c | |||
@@ -156,10 +156,9 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d) | |||
156 | struct dtt200u_fe_state* state = NULL; | 156 | struct dtt200u_fe_state* state = NULL; |
157 | 157 | ||
158 | /* allocate memory for the internal state */ | 158 | /* allocate memory for the internal state */ |
159 | state = (struct dtt200u_fe_state*) kmalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL); | 159 | state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL); |
160 | if (state == NULL) | 160 | if (state == NULL) |
161 | goto error; | 161 | goto error; |
162 | memset(state,0,sizeof(struct dtt200u_fe_state)); | ||
163 | 162 | ||
164 | deb_info("attaching frontend dtt200u\n"); | 163 | deb_info("attaching frontend dtt200u\n"); |
165 | 164 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c index 2e23060cbbca..716f8bf528cd 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c | |||
@@ -154,12 +154,11 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties | |||
154 | } | 154 | } |
155 | 155 | ||
156 | info("found a '%s' in warm state.",desc->name); | 156 | info("found a '%s' in warm state.",desc->name); |
157 | d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL); | 157 | d = kzalloc(sizeof(struct dvb_usb_device),GFP_KERNEL); |
158 | if (d == NULL) { | 158 | if (d == NULL) { |
159 | err("no memory for 'struct dvb_usb_device'"); | 159 | err("no memory for 'struct dvb_usb_device'"); |
160 | return ret; | 160 | return ret; |
161 | } | 161 | } |
162 | memset(d,0,sizeof(struct dvb_usb_device)); | ||
163 | 162 | ||
164 | d->udev = udev; | 163 | d->udev = udev; |
165 | memcpy(&d->props,props,sizeof(struct dvb_usb_properties)); | 164 | memcpy(&d->props,props,sizeof(struct dvb_usb_properties)); |
@@ -167,13 +166,12 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties | |||
167 | d->owner = owner; | 166 | d->owner = owner; |
168 | 167 | ||
169 | if (d->props.size_of_priv > 0) { | 168 | if (d->props.size_of_priv > 0) { |
170 | d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL); | 169 | d->priv = kzalloc(d->props.size_of_priv,GFP_KERNEL); |
171 | if (d->priv == NULL) { | 170 | if (d->priv == NULL) { |
172 | err("no memory for priv in 'struct dvb_usb_device'"); | 171 | err("no memory for priv in 'struct dvb_usb_device'"); |
173 | kfree(d); | 172 | kfree(d); |
174 | return -ENOMEM; | 173 | return -ENOMEM; |
175 | } | 174 | } |
176 | memset(d->priv,0,d->props.size_of_priv); | ||
177 | } | 175 | } |
178 | 176 | ||
179 | usb_set_intfdata(intf, d); | 177 | usb_set_intfdata(intf, d); |
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) { |
diff --git a/drivers/media/dvb/dvb-usb/vp702x-fe.c b/drivers/media/dvb/dvb-usb/vp702x-fe.c index 0885d9fb2bf2..b6d95e1c9c52 100644 --- a/drivers/media/dvb/dvb-usb/vp702x-fe.c +++ b/drivers/media/dvb/dvb-usb/vp702x-fe.c | |||
@@ -281,10 +281,9 @@ static struct dvb_frontend_ops vp702x_fe_ops; | |||
281 | 281 | ||
282 | struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d) | 282 | struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d) |
283 | { | 283 | { |
284 | struct vp702x_fe_state *s = kmalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL); | 284 | struct vp702x_fe_state *s = kzalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL); |
285 | if (s == NULL) | 285 | if (s == NULL) |
286 | goto error; | 286 | goto error; |
287 | memset(s,0,sizeof(struct vp702x_fe_state)); | ||
288 | 287 | ||
289 | s->d = d; | 288 | s->d = d; |
290 | s->fe.ops = &vp702x_fe_ops; | 289 | s->fe.ops = &vp702x_fe_ops; |
diff --git a/drivers/media/dvb/dvb-usb/vp7045-fe.c b/drivers/media/dvb/dvb-usb/vp7045-fe.c index 83f1de1e7e57..5242cca5db4a 100644 --- a/drivers/media/dvb/dvb-usb/vp7045-fe.c +++ b/drivers/media/dvb/dvb-usb/vp7045-fe.c | |||
@@ -145,10 +145,9 @@ static struct dvb_frontend_ops vp7045_fe_ops; | |||
145 | 145 | ||
146 | struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d) | 146 | struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d) |
147 | { | 147 | { |
148 | struct vp7045_fe_state *s = kmalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL); | 148 | struct vp7045_fe_state *s = kzalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL); |
149 | if (s == NULL) | 149 | if (s == NULL) |
150 | goto error; | 150 | goto error; |
151 | memset(s,0,sizeof(struct vp7045_fe_state)); | ||
152 | 151 | ||
153 | s->d = d; | 152 | s->d = d; |
154 | s->fe.ops = &vp7045_fe_ops; | 153 | s->fe.ops = &vp7045_fe_ops; |
diff --git a/drivers/media/dvb/frontends/bcm3510.c b/drivers/media/dvb/frontends/bcm3510.c index 3b132bafd4de..caaee893ca76 100644 --- a/drivers/media/dvb/frontends/bcm3510.c +++ b/drivers/media/dvb/frontends/bcm3510.c | |||
@@ -782,10 +782,9 @@ struct dvb_frontend* bcm3510_attach(const struct bcm3510_config *config, | |||
782 | bcm3510_register_value v; | 782 | bcm3510_register_value v; |
783 | 783 | ||
784 | /* allocate memory for the internal state */ | 784 | /* allocate memory for the internal state */ |
785 | state = kmalloc(sizeof(struct bcm3510_state), GFP_KERNEL); | 785 | state = kzalloc(sizeof(struct bcm3510_state), GFP_KERNEL); |
786 | if (state == NULL) | 786 | if (state == NULL) |
787 | goto error; | 787 | goto error; |
788 | memset(state,0,sizeof(struct bcm3510_state)); | ||
789 | 788 | ||
790 | /* setup the state */ | 789 | /* setup the state */ |
791 | 790 | ||
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c index 6b0553608610..ae589adb1c0a 100644 --- a/drivers/media/dvb/frontends/dib3000mb.c +++ b/drivers/media/dvb/frontends/dib3000mb.c | |||
@@ -700,10 +700,9 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, | |||
700 | struct dib3000_state* state = NULL; | 700 | struct dib3000_state* state = NULL; |
701 | 701 | ||
702 | /* allocate memory for the internal state */ | 702 | /* allocate memory for the internal state */ |
703 | state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL); | 703 | state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL); |
704 | if (state == NULL) | 704 | if (state == NULL) |
705 | goto error; | 705 | goto error; |
706 | memset(state,0,sizeof(struct dib3000_state)); | ||
707 | 706 | ||
708 | /* setup the state */ | 707 | /* setup the state */ |
709 | state->i2c = i2c; | 708 | state->i2c = i2c; |
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c index c024fad17337..3b303dbb6156 100644 --- a/drivers/media/dvb/frontends/dib3000mc.c +++ b/drivers/media/dvb/frontends/dib3000mc.c | |||
@@ -832,10 +832,9 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, | |||
832 | u16 devid; | 832 | u16 devid; |
833 | 833 | ||
834 | /* allocate memory for the internal state */ | 834 | /* allocate memory for the internal state */ |
835 | state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL); | 835 | state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL); |
836 | if (state == NULL) | 836 | if (state == NULL) |
837 | goto error; | 837 | goto error; |
838 | memset(state,0,sizeof(struct dib3000_state)); | ||
839 | 838 | ||
840 | /* setup the state */ | 839 | /* setup the state */ |
841 | state->i2c = i2c; | 840 | state->i2c = i2c; |
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c index 9d214643b87a..4691ac54bc1d 100644 --- a/drivers/media/dvb/frontends/lgdt330x.c +++ b/drivers/media/dvb/frontends/lgdt330x.c | |||
@@ -714,10 +714,9 @@ struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, | |||
714 | u8 buf[1]; | 714 | u8 buf[1]; |
715 | 715 | ||
716 | /* Allocate memory for the internal state */ | 716 | /* Allocate memory for the internal state */ |
717 | state = (struct lgdt330x_state*) kmalloc(sizeof(struct lgdt330x_state), GFP_KERNEL); | 717 | state = kzalloc(sizeof(struct lgdt330x_state), GFP_KERNEL); |
718 | if (state == NULL) | 718 | if (state == NULL) |
719 | goto error; | 719 | goto error; |
720 | memset(state,0,sizeof(*state)); | ||
721 | 720 | ||
722 | /* Setup the state */ | 721 | /* Setup the state */ |
723 | state->config = config; | 722 | state->config = config; |
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c index f0c610f2c2df..aaaec909ddf8 100644 --- a/drivers/media/dvb/frontends/mt352.c +++ b/drivers/media/dvb/frontends/mt352.c | |||
@@ -535,9 +535,8 @@ struct dvb_frontend* mt352_attach(const struct mt352_config* config, | |||
535 | struct mt352_state* state = NULL; | 535 | struct mt352_state* state = NULL; |
536 | 536 | ||
537 | /* allocate memory for the internal state */ | 537 | /* allocate memory for the internal state */ |
538 | state = kmalloc(sizeof(struct mt352_state), GFP_KERNEL); | 538 | state = kzalloc(sizeof(struct mt352_state), GFP_KERNEL); |
539 | if (state == NULL) goto error; | 539 | if (state == NULL) goto error; |
540 | memset(state,0,sizeof(*state)); | ||
541 | 540 | ||
542 | /* setup the state */ | 541 | /* setup the state */ |
543 | state->i2c = i2c; | 542 | state->i2c = i2c; |
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c index aeafef46e3eb..78d2b93d35b9 100644 --- a/drivers/media/dvb/frontends/nxt200x.c +++ b/drivers/media/dvb/frontends/nxt200x.c | |||
@@ -1110,10 +1110,9 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config, | |||
1110 | u8 buf [] = {0,0,0,0,0}; | 1110 | u8 buf [] = {0,0,0,0,0}; |
1111 | 1111 | ||
1112 | /* allocate memory for the internal state */ | 1112 | /* allocate memory for the internal state */ |
1113 | state = (struct nxt200x_state*) kmalloc(sizeof(struct nxt200x_state), GFP_KERNEL); | 1113 | state = kzalloc(sizeof(struct nxt200x_state), GFP_KERNEL); |
1114 | if (state == NULL) | 1114 | if (state == NULL) |
1115 | goto error; | 1115 | goto error; |
1116 | memset(state,0,sizeof(*state)); | ||
1117 | 1116 | ||
1118 | /* setup the state */ | 1117 | /* setup the state */ |
1119 | state->config = config; | 1118 | state->config = config; |
diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c index bbebd1c4caca..1c5316e209ef 100644 --- a/drivers/media/dvb/pluto2/pluto2.c +++ b/drivers/media/dvb/pluto2/pluto2.c | |||
@@ -584,11 +584,10 @@ static int __devinit pluto2_probe(struct pci_dev *pdev, | |||
584 | struct dmx_demux *dmx; | 584 | struct dmx_demux *dmx; |
585 | int ret = -ENOMEM; | 585 | int ret = -ENOMEM; |
586 | 586 | ||
587 | pluto = kmalloc(sizeof(struct pluto), GFP_KERNEL); | 587 | pluto = kzalloc(sizeof(struct pluto), GFP_KERNEL); |
588 | if (!pluto) | 588 | if (!pluto) |
589 | goto out; | 589 | goto out; |
590 | 590 | ||
591 | memset(pluto, 0, sizeof(struct pluto)); | ||
592 | pluto->pdev = pdev; | 591 | pluto->pdev = pdev; |
593 | 592 | ||
594 | ret = pci_enable_device(pdev); | 593 | ret = pci_enable_device(pdev); |
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index 8ce4146f55f1..327a8089193b 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c | |||
@@ -2565,14 +2565,12 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d | |||
2565 | } | 2565 | } |
2566 | 2566 | ||
2567 | /* prepare the av7110 device struct */ | 2567 | /* prepare the av7110 device struct */ |
2568 | av7110 = kmalloc(sizeof(struct av7110), GFP_KERNEL); | 2568 | av7110 = kzalloc(sizeof(struct av7110), GFP_KERNEL); |
2569 | if (!av7110) { | 2569 | if (!av7110) { |
2570 | dprintk(1, "out of memory\n"); | 2570 | dprintk(1, "out of memory\n"); |
2571 | return -ENOMEM; | 2571 | return -ENOMEM; |
2572 | } | 2572 | } |
2573 | 2573 | ||
2574 | memset(av7110, 0, sizeof(struct av7110)); | ||
2575 | |||
2576 | av7110->card_name = (char*) pci_ext->ext_priv; | 2574 | av7110->card_name = (char*) pci_ext->ext_priv; |
2577 | av7110->dev = dev; | 2575 | av7110->dev = dev; |
2578 | dev->ext_priv = av7110; | 2576 | dev->ext_priv = av7110; |
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index f9d00452e639..aa2645895769 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c | |||
@@ -1027,11 +1027,9 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio | |||
1027 | 1027 | ||
1028 | dprintk(2, "dev: %p\n", dev); | 1028 | dprintk(2, "dev: %p\n", dev); |
1029 | 1029 | ||
1030 | if (!(budget_av = kmalloc(sizeof(struct budget_av), GFP_KERNEL))) | 1030 | if (!(budget_av = kzalloc(sizeof(struct budget_av), GFP_KERNEL))) |
1031 | return -ENOMEM; | 1031 | return -ENOMEM; |
1032 | 1032 | ||
1033 | memset(budget_av, 0, sizeof(struct budget_av)); | ||
1034 | |||
1035 | budget_av->has_saa7113 = 0; | 1033 | budget_av->has_saa7113 = 0; |
1036 | budget_av->budget.ci_present = 0; | 1034 | budget_av->budget.ci_present = 0; |
1037 | 1035 | ||
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 104df610dbe1..5a13c4744f61 100644 --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | |||
@@ -1489,11 +1489,9 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
1489 | 1489 | ||
1490 | if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV; | 1490 | if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV; |
1491 | 1491 | ||
1492 | if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL))) | 1492 | if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL))) |
1493 | return -ENOMEM; | 1493 | return -ENOMEM; |
1494 | 1494 | ||
1495 | memset(ttusb, 0, sizeof(struct ttusb)); | ||
1496 | |||
1497 | ttusb->dev = udev; | 1495 | ttusb->dev = udev; |
1498 | ttusb->c = 0; | 1496 | ttusb->c = 0; |
1499 | ttusb->mux_state = 0; | 1497 | ttusb->mux_state = 0; |
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c index d8966d1d25ee..df831171e03c 100644 --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c | |||
@@ -1606,15 +1606,13 @@ static int ttusb_dec_probe(struct usb_interface *intf, | |||
1606 | 1606 | ||
1607 | udev = interface_to_usbdev(intf); | 1607 | udev = interface_to_usbdev(intf); |
1608 | 1608 | ||
1609 | if (!(dec = kmalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) { | 1609 | if (!(dec = kzalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) { |
1610 | printk("%s: couldn't allocate memory.\n", __FUNCTION__); | 1610 | printk("%s: couldn't allocate memory.\n", __FUNCTION__); |
1611 | return -ENOMEM; | 1611 | return -ENOMEM; |
1612 | } | 1612 | } |
1613 | 1613 | ||
1614 | usb_set_intfdata(intf, (void *)dec); | 1614 | usb_set_intfdata(intf, (void *)dec); |
1615 | 1615 | ||
1616 | memset(dec, 0, sizeof(struct ttusb_dec)); | ||
1617 | |||
1618 | switch (le16_to_cpu(id->idProduct)) { | 1616 | switch (le16_to_cpu(id->idProduct)) { |
1619 | case 0x1006: | 1617 | case 0x1006: |
1620 | ttusb_dec_set_model(dec, TTUSB_DEC3000S); | 1618 | ttusb_dec_set_model(dec, TTUSB_DEC3000S); |