diff options
Diffstat (limited to 'drivers/media/video')
59 files changed, 87 insertions, 186 deletions
diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c index e61003de1d5f..4ce07ae62dac 100644 --- a/drivers/media/video/adv7170.c +++ b/drivers/media/video/adv7170.c | |||
@@ -413,10 +413,9 @@ adv7170_detect_client (struct i2c_adapter *adapter, | |||
413 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 413 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
414 | return 0; | 414 | return 0; |
415 | 415 | ||
416 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 416 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
417 | if (client == 0) | 417 | if (client == 0) |
418 | return -ENOMEM; | 418 | return -ENOMEM; |
419 | memset(client, 0, sizeof(struct i2c_client)); | ||
420 | client->addr = address; | 419 | client->addr = address; |
421 | client->adapter = adapter; | 420 | client->adapter = adapter; |
422 | client->driver = &i2c_driver_adv7170; | 421 | client->driver = &i2c_driver_adv7170; |
@@ -433,12 +432,11 @@ adv7170_detect_client (struct i2c_adapter *adapter, | |||
433 | } | 432 | } |
434 | strlcpy(I2C_NAME(client), dname, sizeof(I2C_NAME(client))); | 433 | strlcpy(I2C_NAME(client), dname, sizeof(I2C_NAME(client))); |
435 | 434 | ||
436 | encoder = kmalloc(sizeof(struct adv7170), GFP_KERNEL); | 435 | encoder = kzalloc(sizeof(struct adv7170), GFP_KERNEL); |
437 | if (encoder == NULL) { | 436 | if (encoder == NULL) { |
438 | kfree(client); | 437 | kfree(client); |
439 | return -ENOMEM; | 438 | return -ENOMEM; |
440 | } | 439 | } |
441 | memset(encoder, 0, sizeof(struct adv7170)); | ||
442 | encoder->norm = VIDEO_MODE_NTSC; | 440 | encoder->norm = VIDEO_MODE_NTSC; |
443 | encoder->input = 0; | 441 | encoder->input = 0; |
444 | encoder->enable = 1; | 442 | encoder->enable = 1; |
diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c index 6d9536a71ee4..4e218f22b214 100644 --- a/drivers/media/video/adv7175.c +++ b/drivers/media/video/adv7175.c | |||
@@ -463,10 +463,9 @@ adv7175_detect_client (struct i2c_adapter *adapter, | |||
463 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 463 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
464 | return 0; | 464 | return 0; |
465 | 465 | ||
466 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 466 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
467 | if (client == 0) | 467 | if (client == 0) |
468 | return -ENOMEM; | 468 | return -ENOMEM; |
469 | memset(client, 0, sizeof(struct i2c_client)); | ||
470 | client->addr = address; | 469 | client->addr = address; |
471 | client->adapter = adapter; | 470 | client->adapter = adapter; |
472 | client->driver = &i2c_driver_adv7175; | 471 | client->driver = &i2c_driver_adv7175; |
@@ -483,12 +482,11 @@ adv7175_detect_client (struct i2c_adapter *adapter, | |||
483 | } | 482 | } |
484 | strlcpy(I2C_NAME(client), dname, sizeof(I2C_NAME(client))); | 483 | strlcpy(I2C_NAME(client), dname, sizeof(I2C_NAME(client))); |
485 | 484 | ||
486 | encoder = kmalloc(sizeof(struct adv7175), GFP_KERNEL); | 485 | encoder = kzalloc(sizeof(struct adv7175), GFP_KERNEL); |
487 | if (encoder == NULL) { | 486 | if (encoder == NULL) { |
488 | kfree(client); | 487 | kfree(client); |
489 | return -ENOMEM; | 488 | return -ENOMEM; |
490 | } | 489 | } |
491 | memset(encoder, 0, sizeof(struct adv7175)); | ||
492 | encoder->norm = VIDEO_MODE_PAL; | 490 | encoder->norm = VIDEO_MODE_PAL; |
493 | encoder->input = 0; | 491 | encoder->input = 0; |
494 | encoder->enable = 1; | 492 | encoder->enable = 1; |
diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index 560b99891753..d6447791d0e5 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c | |||
@@ -528,21 +528,18 @@ bt819_detect_client (struct i2c_adapter *adapter, | |||
528 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 528 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
529 | return 0; | 529 | return 0; |
530 | 530 | ||
531 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 531 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
532 | if (client == 0) | 532 | if (client == 0) |
533 | return -ENOMEM; | 533 | return -ENOMEM; |
534 | memset(client, 0, sizeof(struct i2c_client)); | ||
535 | client->addr = address; | 534 | client->addr = address; |
536 | client->adapter = adapter; | 535 | client->adapter = adapter; |
537 | client->driver = &i2c_driver_bt819; | 536 | client->driver = &i2c_driver_bt819; |
538 | 537 | ||
539 | decoder = kmalloc(sizeof(struct bt819), GFP_KERNEL); | 538 | decoder = kzalloc(sizeof(struct bt819), GFP_KERNEL); |
540 | if (decoder == NULL) { | 539 | if (decoder == NULL) { |
541 | kfree(client); | 540 | kfree(client); |
542 | return -ENOMEM; | 541 | return -ENOMEM; |
543 | } | 542 | } |
544 | |||
545 | memset(decoder, 0, sizeof(struct bt819)); | ||
546 | decoder->norm = VIDEO_MODE_NTSC; | 543 | decoder->norm = VIDEO_MODE_NTSC; |
547 | decoder->input = 0; | 544 | decoder->input = 0; |
548 | decoder->enable = 1; | 545 | decoder->enable = 1; |
diff --git a/drivers/media/video/bt832.c b/drivers/media/video/bt832.c index dda4aa6bef27..361a9b6ccce3 100644 --- a/drivers/media/video/bt832.c +++ b/drivers/media/video/bt832.c | |||
@@ -167,9 +167,8 @@ static int bt832_attach(struct i2c_adapter *adap, int addr, int kind) | |||
167 | client_template.adapter = adap; | 167 | client_template.adapter = adap; |
168 | client_template.addr = addr; | 168 | client_template.addr = addr; |
169 | 169 | ||
170 | if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL))) | 170 | if (NULL == (t = kzalloc(sizeof(*t), GFP_KERNEL))) |
171 | return -ENOMEM; | 171 | return -ENOMEM; |
172 | memset(t,0,sizeof(*t)); | ||
173 | t->client = client_template; | 172 | t->client = client_template; |
174 | i2c_set_clientdata(&t->client, t); | 173 | i2c_set_clientdata(&t->client, t); |
175 | i2c_attach_client(&t->client); | 174 | i2c_attach_client(&t->client); |
diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c index 60508069bbed..909b593530ed 100644 --- a/drivers/media/video/bt856.c +++ b/drivers/media/video/bt856.c | |||
@@ -316,21 +316,19 @@ bt856_detect_client (struct i2c_adapter *adapter, | |||
316 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 316 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
317 | return 0; | 317 | return 0; |
318 | 318 | ||
319 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 319 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
320 | if (client == 0) | 320 | if (client == 0) |
321 | return -ENOMEM; | 321 | return -ENOMEM; |
322 | memset(client, 0, sizeof(struct i2c_client)); | ||
323 | client->addr = address; | 322 | client->addr = address; |
324 | client->adapter = adapter; | 323 | client->adapter = adapter; |
325 | client->driver = &i2c_driver_bt856; | 324 | client->driver = &i2c_driver_bt856; |
326 | strlcpy(I2C_NAME(client), "bt856", sizeof(I2C_NAME(client))); | 325 | strlcpy(I2C_NAME(client), "bt856", sizeof(I2C_NAME(client))); |
327 | 326 | ||
328 | encoder = kmalloc(sizeof(struct bt856), GFP_KERNEL); | 327 | encoder = kzalloc(sizeof(struct bt856), GFP_KERNEL); |
329 | if (encoder == NULL) { | 328 | if (encoder == NULL) { |
330 | kfree(client); | 329 | kfree(client); |
331 | return -ENOMEM; | 330 | return -ENOMEM; |
332 | } | 331 | } |
333 | memset(encoder, 0, sizeof(struct bt856)); | ||
334 | encoder->norm = VIDEO_MODE_NTSC; | 332 | encoder->norm = VIDEO_MODE_NTSC; |
335 | encoder->enable = 1; | 333 | encoder->enable = 1; |
336 | i2c_set_clientdata(client, encoder); | 334 | i2c_set_clientdata(client, encoder); |
diff --git a/drivers/media/video/bttv-gpio.c b/drivers/media/video/bttv-gpio.c index 575ce8b8e714..d64accc17b0e 100644 --- a/drivers/media/video/bttv-gpio.c +++ b/drivers/media/video/bttv-gpio.c | |||
@@ -64,10 +64,9 @@ int bttv_sub_add_device(struct bttv_core *core, char *name) | |||
64 | struct bttv_sub_device *sub; | 64 | struct bttv_sub_device *sub; |
65 | int err; | 65 | int err; |
66 | 66 | ||
67 | sub = kmalloc(sizeof(*sub),GFP_KERNEL); | 67 | sub = kzalloc(sizeof(*sub),GFP_KERNEL); |
68 | if (NULL == sub) | 68 | if (NULL == sub) |
69 | return -ENOMEM; | 69 | return -ENOMEM; |
70 | memset(sub,0,sizeof(*sub)); | ||
71 | 70 | ||
72 | sub->core = core; | 71 | sub->core = core; |
73 | sub->dev.parent = &core->pci->dev; | 72 | sub->dev.parent = &core->pci->dev; |
diff --git a/drivers/media/video/cpia_pp.c b/drivers/media/video/cpia_pp.c index 6861d408f1b3..74cff626e044 100644 --- a/drivers/media/video/cpia_pp.c +++ b/drivers/media/video/cpia_pp.c | |||
@@ -702,12 +702,11 @@ static int cpia_pp_register(struct parport *port) | |||
702 | return -ENXIO; | 702 | return -ENXIO; |
703 | } | 703 | } |
704 | 704 | ||
705 | cam = kmalloc(sizeof(struct pp_cam_entry), GFP_KERNEL); | 705 | cam = kzalloc(sizeof(struct pp_cam_entry), GFP_KERNEL); |
706 | if (cam == NULL) { | 706 | if (cam == NULL) { |
707 | LOG("failed to allocate camera structure\n"); | 707 | LOG("failed to allocate camera structure\n"); |
708 | return -ENOMEM; | 708 | return -ENOMEM; |
709 | } | 709 | } |
710 | memset(cam,0,sizeof(struct pp_cam_entry)); | ||
711 | 710 | ||
712 | pdev = parport_register_device(port, "cpia_pp", NULL, NULL, | 711 | pdev = parport_register_device(port, "cpia_pp", NULL, NULL, |
713 | NULL, 0, cam); | 712 | NULL, 0, cam); |
diff --git a/drivers/media/video/cpia_usb.c b/drivers/media/video/cpia_usb.c index 1439cb752874..03275c37c5d3 100644 --- a/drivers/media/video/cpia_usb.c +++ b/drivers/media/video/cpia_usb.c | |||
@@ -499,14 +499,12 @@ static int cpia_probe(struct usb_interface *intf, | |||
499 | 499 | ||
500 | printk(KERN_INFO "USB CPiA camera found\n"); | 500 | printk(KERN_INFO "USB CPiA camera found\n"); |
501 | 501 | ||
502 | ucpia = kmalloc(sizeof(*ucpia), GFP_KERNEL); | 502 | ucpia = kzalloc(sizeof(*ucpia), GFP_KERNEL); |
503 | if (!ucpia) { | 503 | if (!ucpia) { |
504 | printk(KERN_ERR "couldn't kmalloc cpia struct\n"); | 504 | printk(KERN_ERR "couldn't kmalloc cpia struct\n"); |
505 | return -ENOMEM; | 505 | return -ENOMEM; |
506 | } | 506 | } |
507 | 507 | ||
508 | memset(ucpia, 0, sizeof(*ucpia)); | ||
509 | |||
510 | ucpia->dev = udev; | 508 | ucpia->dev = udev; |
511 | ucpia->iface = interface->desc.bInterfaceNumber; | 509 | ucpia->iface = interface->desc.bInterfaceNumber; |
512 | init_waitqueue_head(&ucpia->wq_stream); | 510 | init_waitqueue_head(&ucpia->wq_stream); |
diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c index b421068f7ea3..9a66b5961d19 100644 --- a/drivers/media/video/cs53l32a.c +++ b/drivers/media/video/cs53l32a.c | |||
@@ -141,11 +141,10 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind) | |||
141 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 141 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
142 | return 0; | 142 | return 0; |
143 | 143 | ||
144 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 144 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
145 | if (client == 0) | 145 | if (client == 0) |
146 | return -ENOMEM; | 146 | return -ENOMEM; |
147 | 147 | ||
148 | memset(client, 0, sizeof(struct i2c_client)); | ||
149 | client->addr = address; | 148 | client->addr = address; |
150 | client->adapter = adapter; | 149 | client->adapter = adapter; |
151 | client->driver = &i2c_driver; | 150 | client->driver = &i2c_driver; |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index d45237d508c4..c1734762436d 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -862,11 +862,10 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address, | |||
862 | if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) | 862 | if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) |
863 | return 0; | 863 | return 0; |
864 | 864 | ||
865 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 865 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
866 | if (client == 0) | 866 | if (client == 0) |
867 | return -ENOMEM; | 867 | return -ENOMEM; |
868 | 868 | ||
869 | memset(client, 0, sizeof(struct i2c_client)); | ||
870 | client->addr = address; | 869 | client->addr = address; |
871 | client->adapter = adapter; | 870 | client->adapter = adapter; |
872 | client->driver = &i2c_driver_cx25840; | 871 | client->driver = &i2c_driver_cx25840; |
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index a49062119313..a502a4d6e4ae 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c | |||
@@ -1539,10 +1539,9 @@ static int mpeg_open(struct inode *inode, struct file *file) | |||
1539 | dprintk(1,"open minor=%d\n",minor); | 1539 | dprintk(1,"open minor=%d\n",minor); |
1540 | 1540 | ||
1541 | /* allocate + initialize per filehandle data */ | 1541 | /* allocate + initialize per filehandle data */ |
1542 | fh = kmalloc(sizeof(*fh),GFP_KERNEL); | 1542 | fh = kzalloc(sizeof(*fh),GFP_KERNEL); |
1543 | if (NULL == fh) | 1543 | if (NULL == fh) |
1544 | return -ENOMEM; | 1544 | return -ENOMEM; |
1545 | memset(fh,0,sizeof(*fh)); | ||
1546 | file->private_data = fh; | 1545 | file->private_data = fh; |
1547 | fh->dev = dev; | 1546 | fh->dev = dev; |
1548 | 1547 | ||
@@ -1678,10 +1677,9 @@ static int __devinit blackbird_probe(struct pci_dev *pci_dev, | |||
1678 | goto fail_core; | 1677 | goto fail_core; |
1679 | 1678 | ||
1680 | err = -ENOMEM; | 1679 | err = -ENOMEM; |
1681 | dev = kmalloc(sizeof(*dev),GFP_KERNEL); | 1680 | dev = kzalloc(sizeof(*dev),GFP_KERNEL); |
1682 | if (NULL == dev) | 1681 | if (NULL == dev) |
1683 | goto fail_core; | 1682 | goto fail_core; |
1684 | memset(dev,0,sizeof(*dev)); | ||
1685 | dev->pci = pci_dev; | 1683 | dev->pci = pci_dev; |
1686 | dev->core = core; | 1684 | dev->core = core; |
1687 | dev->width = 720; | 1685 | dev->width = 720; |
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 9975be1aca38..194446f28c55 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c | |||
@@ -1050,11 +1050,10 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci) | |||
1050 | up(&devlist); | 1050 | up(&devlist); |
1051 | return core; | 1051 | return core; |
1052 | } | 1052 | } |
1053 | core = kmalloc(sizeof(*core),GFP_KERNEL); | 1053 | core = kzalloc(sizeof(*core),GFP_KERNEL); |
1054 | if (NULL == core) | 1054 | if (NULL == core) |
1055 | goto fail_unlock; | 1055 | goto fail_unlock; |
1056 | 1056 | ||
1057 | memset(core,0,sizeof(*core)); | ||
1058 | atomic_inc(&core->refcount); | 1057 | atomic_inc(&core->refcount); |
1059 | core->pci_bus = pci->bus->number; | 1058 | core->pci_bus = pci->bus->number; |
1060 | core->pci_slot = PCI_SLOT(pci->devfn); | 1059 | core->pci_slot = PCI_SLOT(pci->devfn); |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 42c012aaa849..e48aa3f6e500 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -657,10 +657,9 @@ static int __devinit dvb_probe(struct pci_dev *pci_dev, | |||
657 | goto fail_core; | 657 | goto fail_core; |
658 | 658 | ||
659 | err = -ENOMEM; | 659 | err = -ENOMEM; |
660 | dev = kmalloc(sizeof(*dev),GFP_KERNEL); | 660 | dev = kzalloc(sizeof(*dev),GFP_KERNEL); |
661 | if (NULL == dev) | 661 | if (NULL == dev) |
662 | goto fail_core; | 662 | goto fail_core; |
663 | memset(dev,0,sizeof(*dev)); | ||
664 | dev->pci = pci_dev; | 663 | dev->pci = pci_dev; |
665 | dev->core = core; | 664 | dev->core = core; |
666 | 665 | ||
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 9a02515fe18b..073494ceab0f 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -750,10 +750,9 @@ static int video_open(struct inode *inode, struct file *file) | |||
750 | minor,radio,v4l2_type_names[type]); | 750 | minor,radio,v4l2_type_names[type]); |
751 | 751 | ||
752 | /* allocate + initialize per filehandle data */ | 752 | /* allocate + initialize per filehandle data */ |
753 | fh = kmalloc(sizeof(*fh),GFP_KERNEL); | 753 | fh = kzalloc(sizeof(*fh),GFP_KERNEL); |
754 | if (NULL == fh) | 754 | if (NULL == fh) |
755 | return -ENOMEM; | 755 | return -ENOMEM; |
756 | memset(fh,0,sizeof(*fh)); | ||
757 | file->private_data = fh; | 756 | file->private_data = fh; |
758 | fh->dev = dev; | 757 | fh->dev = dev; |
759 | fh->radio = radio; | 758 | fh->radio = radio; |
@@ -1809,10 +1808,9 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, | |||
1809 | struct cx88_core *core; | 1808 | struct cx88_core *core; |
1810 | int err; | 1809 | int err; |
1811 | 1810 | ||
1812 | dev = kmalloc(sizeof(*dev),GFP_KERNEL); | 1811 | dev = kzalloc(sizeof(*dev),GFP_KERNEL); |
1813 | if (NULL == dev) | 1812 | if (NULL == dev) |
1814 | return -ENOMEM; | 1813 | return -ENOMEM; |
1815 | memset(dev,0,sizeof(*dev)); | ||
1816 | 1814 | ||
1817 | /* pci init */ | 1815 | /* pci init */ |
1818 | dev->pci = pci_dev; | 1816 | dev->pci = pci_dev; |
diff --git a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c index da9481198c53..2831bdd12057 100644 --- a/drivers/media/video/dpc7146.c +++ b/drivers/media/video/dpc7146.c | |||
@@ -94,12 +94,11 @@ static int dpc_probe(struct saa7146_dev* dev) | |||
94 | struct i2c_client *client; | 94 | struct i2c_client *client; |
95 | struct list_head *item; | 95 | struct list_head *item; |
96 | 96 | ||
97 | dpc = (struct dpc*)kmalloc(sizeof(struct dpc), GFP_KERNEL); | 97 | dpc = kzalloc(sizeof(struct dpc), GFP_KERNEL); |
98 | if( NULL == dpc ) { | 98 | if( NULL == dpc ) { |
99 | printk("dpc_v4l2.o: dpc_probe: not enough kernel memory.\n"); | 99 | printk("dpc_v4l2.o: dpc_probe: not enough kernel memory.\n"); |
100 | return -ENOMEM; | 100 | return -ENOMEM; |
101 | } | 101 | } |
102 | memset(dpc, 0x0, sizeof(struct dpc)); | ||
103 | 102 | ||
104 | /* FIXME: enable i2c-port pins, video-port-pins | 103 | /* FIXME: enable i2c-port pins, video-port-pins |
105 | video port pins should be enabled here ?! */ | 104 | video port pins should be enabled here ?! */ |
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index fdc255918dde..3323dffe26a4 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1861,12 +1861,11 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
1861 | } | 1861 | } |
1862 | 1862 | ||
1863 | /* allocate memory for our device state and initialize it */ | 1863 | /* allocate memory for our device state and initialize it */ |
1864 | dev = kmalloc(sizeof(*dev), GFP_KERNEL); | 1864 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
1865 | if (dev == NULL) { | 1865 | if (dev == NULL) { |
1866 | em28xx_err(DRIVER_NAME ": out of memory!\n"); | 1866 | em28xx_err(DRIVER_NAME ": out of memory!\n"); |
1867 | return -ENOMEM; | 1867 | return -ENOMEM; |
1868 | } | 1868 | } |
1869 | memset(dev, 0, sizeof(*dev)); | ||
1870 | 1869 | ||
1871 | /* compute alternate max packet sizes */ | 1870 | /* compute alternate max packet sizes */ |
1872 | uif = udev->actconfig->interface[0]; | 1871 | uif = udev->actconfig->interface[0]; |
diff --git a/drivers/media/video/hexium_gemini.c b/drivers/media/video/hexium_gemini.c index c9b00eafefde..e7bbeb11553d 100644 --- a/drivers/media/video/hexium_gemini.c +++ b/drivers/media/video/hexium_gemini.c | |||
@@ -240,12 +240,11 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d | |||
240 | 240 | ||
241 | DEB_EE((".\n")); | 241 | DEB_EE((".\n")); |
242 | 242 | ||
243 | hexium = (struct hexium *) kmalloc(sizeof(struct hexium), GFP_KERNEL); | 243 | hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL); |
244 | if (NULL == hexium) { | 244 | if (NULL == hexium) { |
245 | printk("hexium_gemini: not enough kernel memory in hexium_attach().\n"); | 245 | printk("hexium_gemini: not enough kernel memory in hexium_attach().\n"); |
246 | return -ENOMEM; | 246 | return -ENOMEM; |
247 | } | 247 | } |
248 | memset(hexium, 0x0, sizeof(struct hexium)); | ||
249 | dev->ext_priv = hexium; | 248 | dev->ext_priv = hexium; |
250 | 249 | ||
251 | /* enable i2c-port pins */ | 250 | /* enable i2c-port pins */ |
diff --git a/drivers/media/video/hexium_orion.c b/drivers/media/video/hexium_orion.c index 42a9414155c3..0b6c2096ec66 100644 --- a/drivers/media/video/hexium_orion.c +++ b/drivers/media/video/hexium_orion.c | |||
@@ -224,12 +224,11 @@ static int hexium_probe(struct saa7146_dev *dev) | |||
224 | return -EFAULT; | 224 | return -EFAULT; |
225 | } | 225 | } |
226 | 226 | ||
227 | hexium = (struct hexium *) kmalloc(sizeof(struct hexium), GFP_KERNEL); | 227 | hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL); |
228 | if (NULL == hexium) { | 228 | if (NULL == hexium) { |
229 | printk("hexium_orion: hexium_probe: not enough kernel memory.\n"); | 229 | printk("hexium_orion: hexium_probe: not enough kernel memory.\n"); |
230 | return -ENOMEM; | 230 | return -ENOMEM; |
231 | } | 231 | } |
232 | memset(hexium, 0x0, sizeof(struct hexium)); | ||
233 | 232 | ||
234 | /* enable i2c-port pins */ | 233 | /* enable i2c-port pins */ |
235 | saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26)); | 234 | saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26)); |
diff --git a/drivers/media/video/indycam.c b/drivers/media/video/indycam.c index bb5cbecffcc3..7420b79e987a 100644 --- a/drivers/media/video/indycam.c +++ b/drivers/media/video/indycam.c | |||
@@ -289,18 +289,15 @@ static int indycam_attach(struct i2c_adapter *adap, int addr, int kind) | |||
289 | printk(KERN_INFO "SGI IndyCam driver version %s\n", | 289 | printk(KERN_INFO "SGI IndyCam driver version %s\n", |
290 | INDYCAM_MODULE_VERSION); | 290 | INDYCAM_MODULE_VERSION); |
291 | 291 | ||
292 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 292 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
293 | if (!client) | 293 | if (!client) |
294 | return -ENOMEM; | 294 | return -ENOMEM; |
295 | camera = kmalloc(sizeof(struct indycam), GFP_KERNEL); | 295 | camera = kzalloc(sizeof(struct indycam), GFP_KERNEL); |
296 | if (!camera) { | 296 | if (!camera) { |
297 | err = -ENOMEM; | 297 | err = -ENOMEM; |
298 | goto out_free_client; | 298 | goto out_free_client; |
299 | } | 299 | } |
300 | 300 | ||
301 | memset(client, 0, sizeof(struct i2c_client)); | ||
302 | memset(camera, 0, sizeof(struct indycam)); | ||
303 | |||
304 | client->addr = addr; | 301 | client->addr = addr; |
305 | client->adapter = adap; | 302 | client->adapter = adap; |
306 | client->driver = &i2c_driver_indycam; | 303 | client->driver = &i2c_driver_indycam; |
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index 91681aa6c657..8416ceff524b 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c | |||
@@ -177,12 +177,11 @@ static int mxb_probe(struct saa7146_dev* dev) | |||
177 | return -ENODEV; | 177 | return -ENODEV; |
178 | } | 178 | } |
179 | 179 | ||
180 | mxb = (struct mxb*)kmalloc(sizeof(struct mxb), GFP_KERNEL); | 180 | mxb = kzalloc(sizeof(struct mxb), GFP_KERNEL); |
181 | if( NULL == mxb ) { | 181 | if( NULL == mxb ) { |
182 | DEB_D(("not enough kernel memory.\n")); | 182 | DEB_D(("not enough kernel memory.\n")); |
183 | return -ENOMEM; | 183 | return -ENOMEM; |
184 | } | 184 | } |
185 | memset(mxb, 0x0, sizeof(struct mxb)); | ||
186 | 185 | ||
187 | mxb->i2c_adapter = (struct i2c_adapter) { | 186 | mxb->i2c_adapter = (struct i2c_adapter) { |
188 | .class = I2C_CLASS_TV_ANALOG, | 187 | .class = I2C_CLASS_TV_ANALOG, |
diff --git a/drivers/media/video/ovcamchip/ov6x20.c b/drivers/media/video/ovcamchip/ov6x20.c index b3f4d266cede..c04130dab127 100644 --- a/drivers/media/video/ovcamchip/ov6x20.c +++ b/drivers/media/video/ovcamchip/ov6x20.c | |||
@@ -178,10 +178,9 @@ static int ov6x20_init(struct i2c_client *c) | |||
178 | if (rc < 0) | 178 | if (rc < 0) |
179 | return rc; | 179 | return rc; |
180 | 180 | ||
181 | ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL); | 181 | ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL); |
182 | if (!s) | 182 | if (!s) |
183 | return -ENOMEM; | 183 | return -ENOMEM; |
184 | memset(s, 0, sizeof *s); | ||
185 | 184 | ||
186 | s->auto_brt = 1; | 185 | s->auto_brt = 1; |
187 | s->auto_exp = 1; | 186 | s->auto_exp = 1; |
diff --git a/drivers/media/video/ovcamchip/ov6x30.c b/drivers/media/video/ovcamchip/ov6x30.c index 6eab458ab792..73b94f51a85a 100644 --- a/drivers/media/video/ovcamchip/ov6x30.c +++ b/drivers/media/video/ovcamchip/ov6x30.c | |||
@@ -141,10 +141,9 @@ static int ov6x30_init(struct i2c_client *c) | |||
141 | if (rc < 0) | 141 | if (rc < 0) |
142 | return rc; | 142 | return rc; |
143 | 143 | ||
144 | ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL); | 144 | ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL); |
145 | if (!s) | 145 | if (!s) |
146 | return -ENOMEM; | 146 | return -ENOMEM; |
147 | memset(s, 0, sizeof *s); | ||
148 | 147 | ||
149 | s->auto_brt = 1; | 148 | s->auto_brt = 1; |
150 | s->auto_exp = 1; | 149 | s->auto_exp = 1; |
diff --git a/drivers/media/video/ovcamchip/ov76be.c b/drivers/media/video/ovcamchip/ov76be.c index 29bbdc05e3b6..11f6be924d8b 100644 --- a/drivers/media/video/ovcamchip/ov76be.c +++ b/drivers/media/video/ovcamchip/ov76be.c | |||
@@ -105,10 +105,9 @@ static int ov76be_init(struct i2c_client *c) | |||
105 | if (rc < 0) | 105 | if (rc < 0) |
106 | return rc; | 106 | return rc; |
107 | 107 | ||
108 | ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL); | 108 | ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL); |
109 | if (!s) | 109 | if (!s) |
110 | return -ENOMEM; | 110 | return -ENOMEM; |
111 | memset(s, 0, sizeof *s); | ||
112 | 111 | ||
113 | s->auto_brt = 1; | 112 | s->auto_brt = 1; |
114 | s->auto_exp = 1; | 113 | s->auto_exp = 1; |
diff --git a/drivers/media/video/ovcamchip/ov7x10.c b/drivers/media/video/ovcamchip/ov7x10.c index 6c383d4b14fa..5206e7913924 100644 --- a/drivers/media/video/ovcamchip/ov7x10.c +++ b/drivers/media/video/ovcamchip/ov7x10.c | |||
@@ -115,10 +115,9 @@ static int ov7x10_init(struct i2c_client *c) | |||
115 | if (rc < 0) | 115 | if (rc < 0) |
116 | return rc; | 116 | return rc; |
117 | 117 | ||
118 | ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL); | 118 | ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL); |
119 | if (!s) | 119 | if (!s) |
120 | return -ENOMEM; | 120 | return -ENOMEM; |
121 | memset(s, 0, sizeof *s); | ||
122 | 121 | ||
123 | s->auto_brt = 1; | 122 | s->auto_brt = 1; |
124 | s->auto_exp = 1; | 123 | s->auto_exp = 1; |
diff --git a/drivers/media/video/ovcamchip/ov7x20.c b/drivers/media/video/ovcamchip/ov7x20.c index 3c8c48f338ba..8e26ae338f31 100644 --- a/drivers/media/video/ovcamchip/ov7x20.c +++ b/drivers/media/video/ovcamchip/ov7x20.c | |||
@@ -232,10 +232,9 @@ static int ov7x20_init(struct i2c_client *c) | |||
232 | if (rc < 0) | 232 | if (rc < 0) |
233 | return rc; | 233 | return rc; |
234 | 234 | ||
235 | ov->spriv = s = kmalloc(sizeof *s, GFP_KERNEL); | 235 | ov->spriv = s = kzalloc(sizeof *s, GFP_KERNEL); |
236 | if (!s) | 236 | if (!s) |
237 | return -ENOMEM; | 237 | return -ENOMEM; |
238 | memset(s, 0, sizeof *s); | ||
239 | 238 | ||
240 | s->auto_brt = 1; | 239 | s->auto_brt = 1; |
241 | s->auto_exp = DFL_AUTO_EXP; | 240 | s->auto_exp = DFL_AUTO_EXP; |
diff --git a/drivers/media/video/ovcamchip/ovcamchip_core.c b/drivers/media/video/ovcamchip/ovcamchip_core.c index 428f1bb75ec3..e76b53d5909c 100644 --- a/drivers/media/video/ovcamchip/ovcamchip_core.c +++ b/drivers/media/video/ovcamchip/ovcamchip_core.c | |||
@@ -316,12 +316,11 @@ static int ovcamchip_attach(struct i2c_adapter *adap) | |||
316 | c->adapter = adap; | 316 | c->adapter = adap; |
317 | strcpy(c->name, "OV????"); | 317 | strcpy(c->name, "OV????"); |
318 | 318 | ||
319 | ov = kmalloc(sizeof *ov, GFP_KERNEL); | 319 | ov = kzalloc(sizeof *ov, GFP_KERNEL); |
320 | if (!ov) { | 320 | if (!ov) { |
321 | rc = -ENOMEM; | 321 | rc = -ENOMEM; |
322 | goto no_ov; | 322 | goto no_ov; |
323 | } | 323 | } |
324 | memset(ov, 0, sizeof *ov); | ||
325 | i2c_set_clientdata(c, ov); | 324 | i2c_set_clientdata(c, ov); |
326 | 325 | ||
327 | rc = ovcamchip_detect(c); | 326 | rc = ovcamchip_detect(c); |
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c index 0aa9e72f632c..2ce010201308 100644 --- a/drivers/media/video/saa5246a.c +++ b/drivers/media/video/saa5246a.c | |||
@@ -83,13 +83,12 @@ static int saa5246a_attach(struct i2c_adapter *adap, int addr, int kind) | |||
83 | client_template.adapter = adap; | 83 | client_template.adapter = adap; |
84 | client_template.addr = addr; | 84 | client_template.addr = addr; |
85 | memcpy(client, &client_template, sizeof(*client)); | 85 | memcpy(client, &client_template, sizeof(*client)); |
86 | t = kmalloc(sizeof(*t), GFP_KERNEL); | 86 | t = kzalloc(sizeof(*t), GFP_KERNEL); |
87 | if(t==NULL) | 87 | if(t==NULL) |
88 | { | 88 | { |
89 | kfree(client); | 89 | kfree(client); |
90 | return -ENOMEM; | 90 | return -ENOMEM; |
91 | } | 91 | } |
92 | memset(t, 0, sizeof(*t)); | ||
93 | strlcpy(client->name, IF_NAME, I2C_NAME_SIZE); | 92 | strlcpy(client->name, IF_NAME, I2C_NAME_SIZE); |
94 | init_MUTEX(&t->lock); | 93 | init_MUTEX(&t->lock); |
95 | 94 | ||
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c index 73b4f0e2abf0..5694eb58c3a1 100644 --- a/drivers/media/video/saa5249.c +++ b/drivers/media/video/saa5249.c | |||
@@ -151,13 +151,12 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind) | |||
151 | client_template.adapter = adap; | 151 | client_template.adapter = adap; |
152 | client_template.addr = addr; | 152 | client_template.addr = addr; |
153 | memcpy(client, &client_template, sizeof(*client)); | 153 | memcpy(client, &client_template, sizeof(*client)); |
154 | t = kmalloc(sizeof(*t), GFP_KERNEL); | 154 | t = kzalloc(sizeof(*t), GFP_KERNEL); |
155 | if(t==NULL) | 155 | if(t==NULL) |
156 | { | 156 | { |
157 | kfree(client); | 157 | kfree(client); |
158 | return -ENOMEM; | 158 | return -ENOMEM; |
159 | } | 159 | } |
160 | memset(t, 0, sizeof(*t)); | ||
161 | strlcpy(client->name, IF_NAME, I2C_NAME_SIZE); | 160 | strlcpy(client->name, IF_NAME, I2C_NAME_SIZE); |
162 | init_MUTEX(&t->lock); | 161 | init_MUTEX(&t->lock); |
163 | 162 | ||
@@ -165,7 +164,7 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind) | |||
165 | * Now create a video4linux device | 164 | * Now create a video4linux device |
166 | */ | 165 | */ |
167 | 166 | ||
168 | vd = (struct video_device *)kmalloc(sizeof(struct video_device), GFP_KERNEL); | 167 | vd = kmalloc(sizeof(struct video_device), GFP_KERNEL); |
169 | if(vd==NULL) | 168 | if(vd==NULL) |
170 | { | 169 | { |
171 | kfree(t); | 170 | kfree(t); |
diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c index 619ff0b7a1ff..7bb85a7b326e 100644 --- a/drivers/media/video/saa7110.c +++ b/drivers/media/video/saa7110.c | |||
@@ -494,21 +494,19 @@ saa7110_detect_client (struct i2c_adapter *adapter, | |||
494 | I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) | 494 | I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) |
495 | return 0; | 495 | return 0; |
496 | 496 | ||
497 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 497 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
498 | if (client == 0) | 498 | if (client == 0) |
499 | return -ENOMEM; | 499 | return -ENOMEM; |
500 | memset(client, 0, sizeof(struct i2c_client)); | ||
501 | client->addr = address; | 500 | client->addr = address; |
502 | client->adapter = adapter; | 501 | client->adapter = adapter; |
503 | client->driver = &i2c_driver_saa7110; | 502 | client->driver = &i2c_driver_saa7110; |
504 | strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client))); | 503 | strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client))); |
505 | 504 | ||
506 | decoder = kmalloc(sizeof(struct saa7110), GFP_KERNEL); | 505 | decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL); |
507 | if (decoder == 0) { | 506 | if (decoder == 0) { |
508 | kfree(client); | 507 | kfree(client); |
509 | return -ENOMEM; | 508 | return -ENOMEM; |
510 | } | 509 | } |
511 | memset(decoder, 0, sizeof(struct saa7110)); | ||
512 | decoder->norm = VIDEO_MODE_PAL; | 510 | decoder->norm = VIDEO_MODE_PAL; |
513 | decoder->input = 0; | 511 | decoder->input = 0; |
514 | decoder->enable = 1; | 512 | decoder->enable = 1; |
diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c index acaeee592b54..8c06592b37ff 100644 --- a/drivers/media/video/saa7111.c +++ b/drivers/media/video/saa7111.c | |||
@@ -511,21 +511,19 @@ saa7111_detect_client (struct i2c_adapter *adapter, | |||
511 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 511 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
512 | return 0; | 512 | return 0; |
513 | 513 | ||
514 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 514 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
515 | if (client == 0) | 515 | if (client == 0) |
516 | return -ENOMEM; | 516 | return -ENOMEM; |
517 | memset(client, 0, sizeof(struct i2c_client)); | ||
518 | client->addr = address; | 517 | client->addr = address; |
519 | client->adapter = adapter; | 518 | client->adapter = adapter; |
520 | client->driver = &i2c_driver_saa7111; | 519 | client->driver = &i2c_driver_saa7111; |
521 | strlcpy(I2C_NAME(client), "saa7111", sizeof(I2C_NAME(client))); | 520 | strlcpy(I2C_NAME(client), "saa7111", sizeof(I2C_NAME(client))); |
522 | 521 | ||
523 | decoder = kmalloc(sizeof(struct saa7111), GFP_KERNEL); | 522 | decoder = kzalloc(sizeof(struct saa7111), GFP_KERNEL); |
524 | if (decoder == NULL) { | 523 | if (decoder == NULL) { |
525 | kfree(client); | 524 | kfree(client); |
526 | return -ENOMEM; | 525 | return -ENOMEM; |
527 | } | 526 | } |
528 | memset(decoder, 0, sizeof(struct saa7111)); | ||
529 | decoder->norm = VIDEO_MODE_NTSC; | 527 | decoder->norm = VIDEO_MODE_NTSC; |
530 | decoder->input = 0; | 528 | decoder->input = 0; |
531 | decoder->enable = 1; | 529 | decoder->enable = 1; |
diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c index b7ac0122f729..fd0a4b4ef014 100644 --- a/drivers/media/video/saa7114.c +++ b/drivers/media/video/saa7114.c | |||
@@ -852,21 +852,19 @@ saa7114_detect_client (struct i2c_adapter *adapter, | |||
852 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 852 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
853 | return 0; | 853 | return 0; |
854 | 854 | ||
855 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 855 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
856 | if (client == 0) | 856 | if (client == 0) |
857 | return -ENOMEM; | 857 | return -ENOMEM; |
858 | memset(client, 0, sizeof(struct i2c_client)); | ||
859 | client->addr = address; | 858 | client->addr = address; |
860 | client->adapter = adapter; | 859 | client->adapter = adapter; |
861 | client->driver = &i2c_driver_saa7114; | 860 | client->driver = &i2c_driver_saa7114; |
862 | strlcpy(I2C_NAME(client), "saa7114", sizeof(I2C_NAME(client))); | 861 | strlcpy(I2C_NAME(client), "saa7114", sizeof(I2C_NAME(client))); |
863 | 862 | ||
864 | decoder = kmalloc(sizeof(struct saa7114), GFP_KERNEL); | 863 | decoder = kzalloc(sizeof(struct saa7114), GFP_KERNEL); |
865 | if (decoder == NULL) { | 864 | if (decoder == NULL) { |
866 | kfree(client); | 865 | kfree(client); |
867 | return -ENOMEM; | 866 | return -ENOMEM; |
868 | } | 867 | } |
869 | memset(decoder, 0, sizeof(struct saa7114)); | ||
870 | decoder->norm = VIDEO_MODE_NTSC; | 868 | decoder->norm = VIDEO_MODE_NTSC; |
871 | decoder->input = -1; | 869 | decoder->input = -1; |
872 | decoder->enable = 1; | 870 | decoder->enable = 1; |
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 4a4bc69fb0e9..ab8b4bcb5dd6 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -1249,10 +1249,9 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1249 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 1249 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
1250 | return 0; | 1250 | return 0; |
1251 | 1251 | ||
1252 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 1252 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
1253 | if (client == 0) | 1253 | if (client == 0) |
1254 | return -ENOMEM; | 1254 | return -ENOMEM; |
1255 | memset(client, 0, sizeof(struct i2c_client)); | ||
1256 | client->addr = address; | 1255 | client->addr = address; |
1257 | client->adapter = adapter; | 1256 | client->adapter = adapter; |
1258 | client->driver = &i2c_driver_saa7115; | 1257 | client->driver = &i2c_driver_saa7115; |
@@ -1272,13 +1271,12 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1272 | } | 1271 | } |
1273 | v4l_info(client, "saa711%d found @ 0x%x (%s)\n", chip_id, address << 1, adapter->name); | 1272 | v4l_info(client, "saa711%d found @ 0x%x (%s)\n", chip_id, address << 1, adapter->name); |
1274 | 1273 | ||
1275 | state = kmalloc(sizeof(struct saa7115_state), GFP_KERNEL); | 1274 | state = kzalloc(sizeof(struct saa7115_state), GFP_KERNEL); |
1276 | i2c_set_clientdata(client, state); | 1275 | i2c_set_clientdata(client, state); |
1277 | if (state == NULL) { | 1276 | if (state == NULL) { |
1278 | kfree(client); | 1277 | kfree(client); |
1279 | return -ENOMEM; | 1278 | return -ENOMEM; |
1280 | } | 1279 | } |
1281 | memset(state, 0, sizeof(struct saa7115_state)); | ||
1282 | state->std = V4L2_STD_NTSC; | 1280 | state->std = V4L2_STD_NTSC; |
1283 | state->input = -1; | 1281 | state->input = -1; |
1284 | state->enable = 1; | 1282 | state->enable = 1; |
diff --git a/drivers/media/video/saa711x.c b/drivers/media/video/saa711x.c index f39a7be08588..ae53063875f9 100644 --- a/drivers/media/video/saa711x.c +++ b/drivers/media/video/saa711x.c | |||
@@ -487,20 +487,18 @@ saa711x_detect_client (struct i2c_adapter *adapter, | |||
487 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 487 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
488 | return 0; | 488 | return 0; |
489 | 489 | ||
490 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 490 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
491 | if (client == 0) | 491 | if (client == 0) |
492 | return -ENOMEM; | 492 | return -ENOMEM; |
493 | memset(client, 0, sizeof(struct i2c_client)); | ||
494 | client->addr = address; | 493 | client->addr = address; |
495 | client->adapter = adapter; | 494 | client->adapter = adapter; |
496 | client->driver = &i2c_driver_saa711x; | 495 | client->driver = &i2c_driver_saa711x; |
497 | strlcpy(I2C_NAME(client), "saa711x", sizeof(I2C_NAME(client))); | 496 | strlcpy(I2C_NAME(client), "saa711x", sizeof(I2C_NAME(client))); |
498 | decoder = kmalloc(sizeof(struct saa711x), GFP_KERNEL); | 497 | decoder = kzalloc(sizeof(struct saa711x), GFP_KERNEL); |
499 | if (decoder == NULL) { | 498 | if (decoder == NULL) { |
500 | kfree(client); | 499 | kfree(client); |
501 | return -ENOMEM; | 500 | return -ENOMEM; |
502 | } | 501 | } |
503 | memset(decoder, 0, sizeof(struct saa711x)); | ||
504 | decoder->norm = VIDEO_MODE_NTSC; | 502 | decoder->norm = VIDEO_MODE_NTSC; |
505 | decoder->input = 0; | 503 | decoder->input = 0; |
506 | decoder->enable = 1; | 504 | decoder->enable = 1; |
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 2009c1bc4720..d14eb3e5c962 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -689,11 +689,10 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) | |||
689 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 689 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
690 | return 0; | 690 | return 0; |
691 | 691 | ||
692 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 692 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
693 | if (client == 0) | 693 | if (client == 0) |
694 | return -ENOMEM; | 694 | return -ENOMEM; |
695 | 695 | ||
696 | memset(client, 0, sizeof(struct i2c_client)); | ||
697 | client->addr = address; | 696 | client->addr = address; |
698 | client->adapter = adapter; | 697 | client->adapter = adapter; |
699 | client->driver = &i2c_driver_saa7127; | 698 | client->driver = &i2c_driver_saa7127; |
@@ -712,7 +711,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) | |||
712 | kfree(client); | 711 | kfree(client); |
713 | return 0; | 712 | return 0; |
714 | } | 713 | } |
715 | state = kmalloc(sizeof(struct saa7127_state), GFP_KERNEL); | 714 | state = kzalloc(sizeof(struct saa7127_state), GFP_KERNEL); |
716 | 715 | ||
717 | if (state == NULL) { | 716 | if (state == NULL) { |
718 | kfree(client); | 717 | kfree(client); |
@@ -720,7 +719,6 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) | |||
720 | } | 719 | } |
721 | 720 | ||
722 | i2c_set_clientdata(client, state); | 721 | i2c_set_clientdata(client, state); |
723 | memset(state, 0, sizeof(struct saa7127_state)); | ||
724 | 722 | ||
725 | /* Configure Encoder */ | 723 | /* Configure Encoder */ |
726 | 724 | ||
diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c index ad73c4a60f2b..0e0ba50946e8 100644 --- a/drivers/media/video/saa7134/saa6752hs.c +++ b/drivers/media/video/saa7134/saa6752hs.c | |||
@@ -511,9 +511,8 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) | |||
511 | struct saa6752hs_state *h; | 511 | struct saa6752hs_state *h; |
512 | 512 | ||
513 | 513 | ||
514 | if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL))) | 514 | if (NULL == (h = kzalloc(sizeof(*h), GFP_KERNEL))) |
515 | return -ENOMEM; | 515 | return -ENOMEM; |
516 | memset(h,0,sizeof(*h)); | ||
517 | h->client = client_template; | 516 | h->client = client_template; |
518 | h->params = param_defaults; | 517 | h->params = param_defaults; |
519 | h->client.adapter = adap; | 518 | h->client.adapter = adap; |
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index accbc32725cf..3983a6524cac 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
@@ -803,10 +803,9 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, | |||
803 | struct saa7134_mpeg_ops *mops; | 803 | struct saa7134_mpeg_ops *mops; |
804 | int err; | 804 | int err; |
805 | 805 | ||
806 | dev = kmalloc(sizeof(*dev),GFP_KERNEL); | 806 | dev = kzalloc(sizeof(*dev),GFP_KERNEL); |
807 | if (NULL == dev) | 807 | if (NULL == dev) |
808 | return -ENOMEM; | 808 | return -ENOMEM; |
809 | memset(dev,0,sizeof(*dev)); | ||
810 | 809 | ||
811 | /* pci init */ | 810 | /* pci init */ |
812 | dev->pci = pci_dev; | 811 | dev->pci = pci_dev; |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index adfa8fe49a11..e97426bc85df 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -1264,10 +1264,9 @@ static int video_open(struct inode *inode, struct file *file) | |||
1264 | v4l2_type_names[type]); | 1264 | v4l2_type_names[type]); |
1265 | 1265 | ||
1266 | /* allocate + initialize per filehandle data */ | 1266 | /* allocate + initialize per filehandle data */ |
1267 | fh = kmalloc(sizeof(*fh),GFP_KERNEL); | 1267 | fh = kzalloc(sizeof(*fh),GFP_KERNEL); |
1268 | if (NULL == fh) | 1268 | if (NULL == fh) |
1269 | return -ENOMEM; | 1269 | return -ENOMEM; |
1270 | memset(fh,0,sizeof(*fh)); | ||
1271 | file->private_data = fh; | 1270 | file->private_data = fh; |
1272 | fh->dev = dev; | 1271 | fh->dev = dev; |
1273 | fh->radio = radio; | 1272 | fh->radio = radio; |
diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c index f72a9f796209..3ed0edb870a4 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c | |||
@@ -408,21 +408,19 @@ saa7185_detect_client (struct i2c_adapter *adapter, | |||
408 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 408 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
409 | return 0; | 409 | return 0; |
410 | 410 | ||
411 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 411 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
412 | if (client == 0) | 412 | if (client == 0) |
413 | return -ENOMEM; | 413 | return -ENOMEM; |
414 | memset(client, 0, sizeof(struct i2c_client)); | ||
415 | client->addr = address; | 414 | client->addr = address; |
416 | client->adapter = adapter; | 415 | client->adapter = adapter; |
417 | client->driver = &i2c_driver_saa7185; | 416 | client->driver = &i2c_driver_saa7185; |
418 | strlcpy(I2C_NAME(client), "saa7185", sizeof(I2C_NAME(client))); | 417 | strlcpy(I2C_NAME(client), "saa7185", sizeof(I2C_NAME(client))); |
419 | 418 | ||
420 | encoder = kmalloc(sizeof(struct saa7185), GFP_KERNEL); | 419 | encoder = kzalloc(sizeof(struct saa7185), GFP_KERNEL); |
421 | if (encoder == NULL) { | 420 | if (encoder == NULL) { |
422 | kfree(client); | 421 | kfree(client); |
423 | return -ENOMEM; | 422 | return -ENOMEM; |
424 | } | 423 | } |
425 | memset(encoder, 0, sizeof(struct saa7185)); | ||
426 | encoder->norm = VIDEO_MODE_NTSC; | 424 | encoder->norm = VIDEO_MODE_NTSC; |
427 | encoder->enable = 1; | 425 | encoder->enable = 1; |
428 | i2c_set_clientdata(client, encoder); | 426 | i2c_set_clientdata(client, encoder); |
diff --git a/drivers/media/video/saa7191.c b/drivers/media/video/saa7191.c index 41f6f05a0436..746cadb8f1c4 100644 --- a/drivers/media/video/saa7191.c +++ b/drivers/media/video/saa7191.c | |||
@@ -571,18 +571,15 @@ static int saa7191_attach(struct i2c_adapter *adap, int addr, int kind) | |||
571 | printk(KERN_INFO "Philips SAA7191 driver version %s\n", | 571 | printk(KERN_INFO "Philips SAA7191 driver version %s\n", |
572 | SAA7191_MODULE_VERSION); | 572 | SAA7191_MODULE_VERSION); |
573 | 573 | ||
574 | client = kmalloc(sizeof(*client), GFP_KERNEL); | 574 | client = kzalloc(sizeof(*client), GFP_KERNEL); |
575 | if (!client) | 575 | if (!client) |
576 | return -ENOMEM; | 576 | return -ENOMEM; |
577 | decoder = kmalloc(sizeof(*decoder), GFP_KERNEL); | 577 | decoder = kzalloc(sizeof(*decoder), GFP_KERNEL); |
578 | if (!decoder) { | 578 | if (!decoder) { |
579 | err = -ENOMEM; | 579 | err = -ENOMEM; |
580 | goto out_free_client; | 580 | goto out_free_client; |
581 | } | 581 | } |
582 | 582 | ||
583 | memset(client, 0, sizeof(struct i2c_client)); | ||
584 | memset(decoder, 0, sizeof(struct saa7191)); | ||
585 | |||
586 | client->addr = addr; | 583 | client->addr = addr; |
587 | client->adapter = adap; | 584 | client->adapter = adap; |
588 | client->driver = &i2c_driver_saa7191; | 585 | client->driver = &i2c_driver_saa7191; |
diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c index 99261f15e66e..873796bedec8 100644 --- a/drivers/media/video/tda7432.c +++ b/drivers/media/video/tda7432.c | |||
@@ -300,10 +300,9 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind) | |||
300 | struct tda7432 *t; | 300 | struct tda7432 *t; |
301 | struct i2c_client *client; | 301 | struct i2c_client *client; |
302 | 302 | ||
303 | t = kmalloc(sizeof *t,GFP_KERNEL); | 303 | t = kzalloc(sizeof *t,GFP_KERNEL); |
304 | if (!t) | 304 | if (!t) |
305 | return -ENOMEM; | 305 | return -ENOMEM; |
306 | memset(t,0,sizeof *t); | ||
307 | 306 | ||
308 | client = &t->c; | 307 | client = &t->c; |
309 | memcpy(client,&client_template,sizeof(struct i2c_client)); | 308 | memcpy(client,&client_template,sizeof(struct i2c_client)); |
diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c index 299393bf900a..ef98c4982250 100644 --- a/drivers/media/video/tda9875.c +++ b/drivers/media/video/tda9875.c | |||
@@ -232,10 +232,9 @@ static int tda9875_attach(struct i2c_adapter *adap, int addr, int kind) | |||
232 | struct i2c_client *client; | 232 | struct i2c_client *client; |
233 | dprintk("In tda9875_attach\n"); | 233 | dprintk("In tda9875_attach\n"); |
234 | 234 | ||
235 | t = kmalloc(sizeof *t,GFP_KERNEL); | 235 | t = kzalloc(sizeof *t,GFP_KERNEL); |
236 | if (!t) | 236 | if (!t) |
237 | return -ENOMEM; | 237 | return -ENOMEM; |
238 | memset(t,0,sizeof *t); | ||
239 | 238 | ||
240 | client = &t->c; | 239 | client = &t->c; |
241 | memcpy(client,&client_template,sizeof(struct i2c_client)); | 240 | memcpy(client,&client_template,sizeof(struct i2c_client)); |
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 9cf47dc65579..5815649bdc78 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c | |||
@@ -696,9 +696,8 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind) | |||
696 | client_template.adapter = adap; | 696 | client_template.adapter = adap; |
697 | client_template.addr = addr; | 697 | client_template.addr = addr; |
698 | 698 | ||
699 | if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL))) | 699 | if (NULL == (t = kzalloc(sizeof(*t), GFP_KERNEL))) |
700 | return -ENOMEM; | 700 | return -ENOMEM; |
701 | memset(t,0,sizeof(*t)); | ||
702 | 701 | ||
703 | t->client = client_template; | 702 | t->client = client_template; |
704 | t->std = 0; | 703 | t->std = 0; |
diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c index c4ba3742f5c7..4dcba5a4fff0 100644 --- a/drivers/media/video/tea6420.c +++ b/drivers/media/video/tea6420.c | |||
@@ -99,11 +99,10 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind) | |||
99 | } | 99 | } |
100 | 100 | ||
101 | /* allocate memory for client structure */ | 101 | /* allocate memory for client structure */ |
102 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 102 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
103 | if (0 == client) { | 103 | if (0 == client) { |
104 | return -ENOMEM; | 104 | return -ENOMEM; |
105 | } | 105 | } |
106 | memset(client, 0x0, sizeof(struct i2c_client)); | ||
107 | 106 | ||
108 | /* fill client structure */ | 107 | /* fill client structure */ |
109 | memcpy(client, &client_template, sizeof(struct i2c_client)); | 108 | memcpy(client, &client_template, sizeof(struct i2c_client)); |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 57bc585a6955..89d013ce5edb 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -410,10 +410,9 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) | |||
410 | client_template.adapter = adap; | 410 | client_template.adapter = adap; |
411 | client_template.addr = addr; | 411 | client_template.addr = addr; |
412 | 412 | ||
413 | t = kmalloc(sizeof(struct tuner), GFP_KERNEL); | 413 | t = kzalloc(sizeof(struct tuner), GFP_KERNEL); |
414 | if (NULL == t) | 414 | if (NULL == t) |
415 | return -ENOMEM; | 415 | return -ENOMEM; |
416 | memset(t, 0, sizeof(struct tuner)); | ||
417 | memcpy(&t->i2c, &client_template, sizeof(struct i2c_client)); | 416 | memcpy(&t->i2c, &client_template, sizeof(struct i2c_client)); |
418 | i2c_set_clientdata(&t->i2c, t); | 417 | i2c_set_clientdata(&t->i2c, t); |
419 | t->type = UNSET; | 418 | t->type = UNSET; |
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index b582943a0d3e..9baa6392e9b5 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c | |||
@@ -1468,10 +1468,9 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind) | |||
1468 | struct CHIPSTATE *chip; | 1468 | struct CHIPSTATE *chip; |
1469 | struct CHIPDESC *desc; | 1469 | struct CHIPDESC *desc; |
1470 | 1470 | ||
1471 | chip = kmalloc(sizeof(*chip),GFP_KERNEL); | 1471 | chip = kzalloc(sizeof(*chip),GFP_KERNEL); |
1472 | if (!chip) | 1472 | if (!chip) |
1473 | return -ENOMEM; | 1473 | return -ENOMEM; |
1474 | memset(chip,0,sizeof(*chip)); | ||
1475 | memcpy(&chip->c,&client_template,sizeof(struct i2c_client)); | 1474 | memcpy(&chip->c,&client_template,sizeof(struct i2c_client)); |
1476 | chip->c.adapter = adap; | 1475 | chip->c.adapter = adap; |
1477 | chip->c.addr = addr; | 1476 | chip->c.addr = addr; |
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index fd0acc5da667..5e71a354e879 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c | |||
@@ -719,8 +719,7 @@ tveeprom_command(struct i2c_client *client, | |||
719 | 719 | ||
720 | switch (cmd) { | 720 | switch (cmd) { |
721 | case 0: | 721 | case 0: |
722 | buf = kmalloc(256,GFP_KERNEL); | 722 | buf = kzalloc(256,GFP_KERNEL); |
723 | memset(buf,0,256); | ||
724 | tveeprom_read(client,buf,256); | 723 | tveeprom_read(client,buf,256); |
725 | tveeprom_hauppauge_analog(client, &eeprom,buf); | 724 | tveeprom_hauppauge_analog(client, &eeprom,buf); |
726 | kfree(buf); | 725 | kfree(buf); |
@@ -743,10 +742,9 @@ tveeprom_detect_client(struct i2c_adapter *adapter, | |||
743 | { | 742 | { |
744 | struct i2c_client *client; | 743 | struct i2c_client *client; |
745 | 744 | ||
746 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 745 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
747 | if (NULL == client) | 746 | if (NULL == client) |
748 | return -ENOMEM; | 747 | return -ENOMEM; |
749 | memset(client, 0, sizeof(struct i2c_client)); | ||
750 | client->addr = address; | 748 | client->addr = address; |
751 | client->adapter = adapter; | 749 | client->adapter = adapter; |
752 | client->driver = &i2c_driver_tveeprom; | 750 | client->driver = &i2c_driver_tveeprom; |
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index c35b8042eee5..e86b522938fd 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c | |||
@@ -1074,12 +1074,11 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter, | |||
1074 | return -ENOMEM; | 1074 | return -ENOMEM; |
1075 | memcpy(c, &client_template, sizeof(struct i2c_client)); | 1075 | memcpy(c, &client_template, sizeof(struct i2c_client)); |
1076 | 1076 | ||
1077 | core = kmalloc(sizeof(struct tvp5150), GFP_KERNEL); | 1077 | core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL); |
1078 | if (core == 0) { | 1078 | if (core == 0) { |
1079 | kfree(c); | 1079 | kfree(c); |
1080 | return -ENOMEM; | 1080 | return -ENOMEM; |
1081 | } | 1081 | } |
1082 | memset(core, 0, sizeof(struct tvp5150)); | ||
1083 | i2c_set_clientdata(c, core); | 1082 | i2c_set_clientdata(c, core); |
1084 | 1083 | ||
1085 | rv = i2c_attach_client(c); | 1084 | rv = i2c_attach_client(c); |
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 2ab5b4093800..474a29bc1760 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c | |||
@@ -305,9 +305,8 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
305 | { | 305 | { |
306 | struct video_capability *cap = arg; | 306 | struct video_capability *cap = arg; |
307 | 307 | ||
308 | cap2 = kmalloc(sizeof(*cap2),GFP_KERNEL); | 308 | cap2 = kzalloc(sizeof(*cap2),GFP_KERNEL); |
309 | memset(cap, 0, sizeof(*cap)); | 309 | memset(cap, 0, sizeof(*cap)); |
310 | memset(cap2, 0, sizeof(*cap2)); | ||
311 | memset(&fbuf2, 0, sizeof(fbuf2)); | 310 | memset(&fbuf2, 0, sizeof(fbuf2)); |
312 | 311 | ||
313 | err = drv(inode, file, VIDIOC_QUERYCAP, cap2); | 312 | err = drv(inode, file, VIDIOC_QUERYCAP, cap2); |
@@ -422,9 +421,8 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
422 | { | 421 | { |
423 | struct video_window *win = arg; | 422 | struct video_window *win = arg; |
424 | 423 | ||
425 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 424 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
426 | memset(win,0,sizeof(*win)); | 425 | memset(win,0,sizeof(*win)); |
427 | memset(fmt2,0,sizeof(*fmt2)); | ||
428 | 426 | ||
429 | fmt2->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; | 427 | fmt2->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; |
430 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 428 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
@@ -461,8 +459,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
461 | struct video_window *win = arg; | 459 | struct video_window *win = arg; |
462 | int err1,err2; | 460 | int err1,err2; |
463 | 461 | ||
464 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 462 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
465 | memset(fmt2,0,sizeof(*fmt2)); | ||
466 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 463 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
467 | drv(inode, file, VIDIOC_STREAMOFF, &fmt2->type); | 464 | drv(inode, file, VIDIOC_STREAMOFF, &fmt2->type); |
468 | err1 = drv(inode, file, VIDIOC_G_FMT, fmt2); | 465 | err1 = drv(inode, file, VIDIOC_G_FMT, fmt2); |
@@ -595,8 +592,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
595 | pict->whiteness = get_v4l_control(inode, file, | 592 | pict->whiteness = get_v4l_control(inode, file, |
596 | V4L2_CID_WHITENESS, drv); | 593 | V4L2_CID_WHITENESS, drv); |
597 | 594 | ||
598 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 595 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
599 | memset(fmt2,0,sizeof(*fmt2)); | ||
600 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 596 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
601 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 597 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
602 | if (err < 0) { | 598 | if (err < 0) { |
@@ -622,8 +618,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
622 | set_v4l_control(inode, file, | 618 | set_v4l_control(inode, file, |
623 | V4L2_CID_WHITENESS, pict->whiteness, drv); | 619 | V4L2_CID_WHITENESS, pict->whiteness, drv); |
624 | 620 | ||
625 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 621 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
626 | memset(fmt2,0,sizeof(*fmt2)); | ||
627 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 622 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
628 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 623 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
629 | if (err < 0) | 624 | if (err < 0) |
@@ -846,9 +841,8 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
846 | { | 841 | { |
847 | struct video_mmap *mm = arg; | 842 | struct video_mmap *mm = arg; |
848 | 843 | ||
849 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 844 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
850 | memset(&buf2,0,sizeof(buf2)); | 845 | memset(&buf2,0,sizeof(buf2)); |
851 | memset(fmt2,0,sizeof(*fmt2)); | ||
852 | 846 | ||
853 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 847 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
854 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 848 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
@@ -942,8 +936,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
942 | { | 936 | { |
943 | struct vbi_format *fmt = arg; | 937 | struct vbi_format *fmt = arg; |
944 | 938 | ||
945 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 939 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
946 | memset(fmt2, 0, sizeof(*fmt2)); | ||
947 | fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; | 940 | fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; |
948 | 941 | ||
949 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 942 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
@@ -975,8 +968,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
975 | break; | 968 | break; |
976 | } | 969 | } |
977 | 970 | ||
978 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 971 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
979 | memset(fmt2, 0, sizeof(*fmt2)); | ||
980 | 972 | ||
981 | fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; | 973 | fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; |
982 | fmt2->fmt.vbi.samples_per_line = fmt->samples_per_line; | 974 | fmt2->fmt.vbi.samples_per_line = fmt->samples_per_line; |
diff --git a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c index 9a6bf287e26a..9ef477523d27 100644 --- a/drivers/media/video/video-buf.c +++ b/drivers/media/video/video-buf.c | |||
@@ -52,10 +52,9 @@ videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages) | |||
52 | struct page *pg; | 52 | struct page *pg; |
53 | int i; | 53 | int i; |
54 | 54 | ||
55 | sglist = kmalloc(sizeof(struct scatterlist)*nr_pages, GFP_KERNEL); | 55 | sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL); |
56 | if (NULL == sglist) | 56 | if (NULL == sglist) |
57 | return NULL; | 57 | return NULL; |
58 | memset(sglist,0,sizeof(struct scatterlist)*nr_pages); | ||
59 | for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { | 58 | for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { |
60 | pg = vmalloc_to_page(virt); | 59 | pg = vmalloc_to_page(virt); |
61 | if (NULL == pg) | 60 | if (NULL == pg) |
@@ -80,10 +79,9 @@ videobuf_pages_to_sg(struct page **pages, int nr_pages, int offset) | |||
80 | 79 | ||
81 | if (NULL == pages[0]) | 80 | if (NULL == pages[0]) |
82 | return NULL; | 81 | return NULL; |
83 | sglist = kmalloc(sizeof(*sglist) * nr_pages, GFP_KERNEL); | 82 | sglist = kcalloc(nr_pages, sizeof(*sglist), GFP_KERNEL); |
84 | if (NULL == sglist) | 83 | if (NULL == sglist) |
85 | return NULL; | 84 | return NULL; |
86 | memset(sglist, 0, sizeof(*sglist) * nr_pages); | ||
87 | 85 | ||
88 | if (NULL == pages[0]) | 86 | if (NULL == pages[0]) |
89 | goto nopage; | 87 | goto nopage; |
@@ -284,9 +282,8 @@ void* videobuf_alloc(unsigned int size) | |||
284 | { | 282 | { |
285 | struct videobuf_buffer *vb; | 283 | struct videobuf_buffer *vb; |
286 | 284 | ||
287 | vb = kmalloc(size,GFP_KERNEL); | 285 | vb = kzalloc(size,GFP_KERNEL); |
288 | if (NULL != vb) { | 286 | if (NULL != vb) { |
289 | memset(vb,0,size); | ||
290 | videobuf_dma_init(&vb->dma); | 287 | videobuf_dma_init(&vb->dma); |
291 | init_waitqueue_head(&vb->done); | 288 | init_waitqueue_head(&vb->done); |
292 | vb->magic = MAGIC_BUFFER; | 289 | vb->magic = MAGIC_BUFFER; |
diff --git a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c index 839db622040d..8f271de57fd6 100644 --- a/drivers/media/video/videocodec.c +++ b/drivers/media/video/videocodec.c | |||
@@ -124,17 +124,13 @@ videocodec_attach (struct videocodec_master *master) | |||
124 | if (res == 0) { | 124 | if (res == 0) { |
125 | dprintk(3, "videocodec_attach '%s'\n", | 125 | dprintk(3, "videocodec_attach '%s'\n", |
126 | codec->name); | 126 | codec->name); |
127 | ptr = (struct attached_list *) | 127 | ptr = kzalloc(sizeof(struct attached_list), GFP_KERNEL); |
128 | kmalloc(sizeof(struct attached_list), | ||
129 | GFP_KERNEL); | ||
130 | if (!ptr) { | 128 | if (!ptr) { |
131 | dprintk(1, | 129 | dprintk(1, |
132 | KERN_ERR | 130 | KERN_ERR |
133 | "videocodec_attach: no memory\n"); | 131 | "videocodec_attach: no memory\n"); |
134 | goto out_kfree; | 132 | goto out_kfree; |
135 | } | 133 | } |
136 | memset(ptr, 0, | ||
137 | sizeof(struct attached_list)); | ||
138 | ptr->codec = codec; | 134 | ptr->codec = codec; |
139 | 135 | ||
140 | a = h->list; | 136 | a = h->list; |
@@ -249,14 +245,11 @@ videocodec_register (const struct videocodec *codec) | |||
249 | "videocodec: register '%s', type: %x, flags %lx, magic %lx\n", | 245 | "videocodec: register '%s', type: %x, flags %lx, magic %lx\n", |
250 | codec->name, codec->type, codec->flags, codec->magic); | 246 | codec->name, codec->type, codec->flags, codec->magic); |
251 | 247 | ||
252 | ptr = | 248 | ptr = kzalloc(sizeof(struct codec_list), GFP_KERNEL); |
253 | (struct codec_list *) kmalloc(sizeof(struct codec_list), | ||
254 | GFP_KERNEL); | ||
255 | if (!ptr) { | 249 | if (!ptr) { |
256 | dprintk(1, KERN_ERR "videocodec_register: no memory\n"); | 250 | dprintk(1, KERN_ERR "videocodec_register: no memory\n"); |
257 | return -ENOMEM; | 251 | return -ENOMEM; |
258 | } | 252 | } |
259 | memset(ptr, 0, sizeof(struct codec_list)); | ||
260 | ptr->codec = codec; | 253 | ptr->codec = codec; |
261 | 254 | ||
262 | if (!h) { | 255 | if (!h) { |
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 9a9902c56ae7..d5be25987142 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -52,10 +52,7 @@ struct video_device *video_device_alloc(void) | |||
52 | { | 52 | { |
53 | struct video_device *vfd; | 53 | struct video_device *vfd; |
54 | 54 | ||
55 | vfd = kmalloc(sizeof(*vfd),GFP_KERNEL); | 55 | vfd = kzalloc(sizeof(*vfd),GFP_KERNEL); |
56 | if (NULL == vfd) | ||
57 | return NULL; | ||
58 | memset(vfd,0,sizeof(*vfd)); | ||
59 | return vfd; | 56 | return vfd; |
60 | } | 57 | } |
61 | 58 | ||
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c index 71b28e9e0850..c8fd8238904d 100644 --- a/drivers/media/video/vino.c +++ b/drivers/media/video/vino.c | |||
@@ -4499,13 +4499,11 @@ static int vino_init(void) | |||
4499 | dma_addr_t dma_dummy_address; | 4499 | dma_addr_t dma_dummy_address; |
4500 | int i; | 4500 | int i; |
4501 | 4501 | ||
4502 | vino_drvdata = (struct vino_settings *) | 4502 | vino_drvdata = kzalloc(sizeof(struct vino_settings), GFP_KERNEL); |
4503 | kmalloc(sizeof(struct vino_settings), GFP_KERNEL); | ||
4504 | if (!vino_drvdata) { | 4503 | if (!vino_drvdata) { |
4505 | vino_module_cleanup(vino_init_stage); | 4504 | vino_module_cleanup(vino_init_stage); |
4506 | return -ENOMEM; | 4505 | return -ENOMEM; |
4507 | } | 4506 | } |
4508 | memset(vino_drvdata, 0, sizeof(struct vino_settings)); | ||
4509 | vino_init_stage++; | 4507 | vino_init_stage++; |
4510 | 4508 | ||
4511 | /* create a dummy dma descriptor */ | 4509 | /* create a dummy dma descriptor */ |
diff --git a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c index 8dcee8b60e21..d0a1e72ea8c4 100644 --- a/drivers/media/video/vpx3220.c +++ b/drivers/media/video/vpx3220.c | |||
@@ -621,13 +621,11 @@ vpx3220_detect_client (struct i2c_adapter *adapter, | |||
621 | (adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) | 621 | (adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) |
622 | return 0; | 622 | return 0; |
623 | 623 | ||
624 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 624 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
625 | if (client == NULL) { | 625 | if (client == NULL) { |
626 | return -ENOMEM; | 626 | return -ENOMEM; |
627 | } | 627 | } |
628 | 628 | ||
629 | memset(client, 0, sizeof(struct i2c_client)); | ||
630 | |||
631 | client->addr = address; | 629 | client->addr = address; |
632 | client->adapter = adapter; | 630 | client->adapter = adapter; |
633 | client->driver = &vpx3220_i2c_driver; | 631 | client->driver = &vpx3220_i2c_driver; |
@@ -675,12 +673,11 @@ vpx3220_detect_client (struct i2c_adapter *adapter, | |||
675 | sizeof(I2C_NAME(client))); | 673 | sizeof(I2C_NAME(client))); |
676 | } | 674 | } |
677 | 675 | ||
678 | decoder = kmalloc(sizeof(struct vpx3220), GFP_KERNEL); | 676 | decoder = kzalloc(sizeof(struct vpx3220), GFP_KERNEL); |
679 | if (decoder == NULL) { | 677 | if (decoder == NULL) { |
680 | kfree(client); | 678 | kfree(client); |
681 | return -ENOMEM; | 679 | return -ENOMEM; |
682 | } | 680 | } |
683 | memset(decoder, 0, sizeof(struct vpx3220)); | ||
684 | decoder->norm = VIDEO_MODE_PAL; | 681 | decoder->norm = VIDEO_MODE_PAL; |
685 | decoder->input = 0; | 682 | decoder->input = 0; |
686 | decoder->enable = 1; | 683 | decoder->enable = 1; |
diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c index c2e6d2e9f5f1..8cb64f8a8a91 100644 --- a/drivers/media/video/wm8775.c +++ b/drivers/media/video/wm8775.c | |||
@@ -166,11 +166,10 @@ static int wm8775_attach(struct i2c_adapter *adapter, int address, int kind) | |||
166 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 166 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
167 | return 0; | 167 | return 0; |
168 | 168 | ||
169 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 169 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
170 | if (client == 0) | 170 | if (client == 0) |
171 | return -ENOMEM; | 171 | return -ENOMEM; |
172 | 172 | ||
173 | memset(client, 0, sizeof(struct i2c_client)); | ||
174 | client->addr = address; | 173 | client->addr = address; |
175 | client->adapter = adapter; | 174 | client->adapter = adapter; |
176 | client->driver = &i2c_driver; | 175 | client->driver = &i2c_driver; |
diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c index 39a0d238900e..ea3288661a34 100644 --- a/drivers/media/video/zoran_card.c +++ b/drivers/media/video/zoran_card.c | |||
@@ -1050,7 +1050,7 @@ zr36057_init (struct zoran *zr) | |||
1050 | /* allocate memory *before* doing anything to the hardware | 1050 | /* allocate memory *before* doing anything to the hardware |
1051 | * in case allocation fails */ | 1051 | * in case allocation fails */ |
1052 | mem_needed = BUZ_NUM_STAT_COM * 4; | 1052 | mem_needed = BUZ_NUM_STAT_COM * 4; |
1053 | mem = (unsigned long) kmalloc(mem_needed, GFP_KERNEL); | 1053 | mem = kzalloc(mem_needed, GFP_KERNEL); |
1054 | vdev = (void *) kmalloc(sizeof(struct video_device), GFP_KERNEL); | 1054 | vdev = (void *) kmalloc(sizeof(struct video_device), GFP_KERNEL); |
1055 | if (!mem || !vdev) { | 1055 | if (!mem || !vdev) { |
1056 | dprintk(1, | 1056 | dprintk(1, |
@@ -1061,7 +1061,6 @@ zr36057_init (struct zoran *zr) | |||
1061 | kfree((void *)mem); | 1061 | kfree((void *)mem); |
1062 | return -ENOMEM; | 1062 | return -ENOMEM; |
1063 | } | 1063 | } |
1064 | memset((void *) mem, 0, mem_needed); | ||
1065 | zr->stat_com = (u32 *) mem; | 1064 | zr->stat_com = (u32 *) mem; |
1066 | for (j = 0; j < BUZ_NUM_STAT_COM; j++) { | 1065 | for (j = 0; j < BUZ_NUM_STAT_COM; j++) { |
1067 | zr->stat_com[j] = 1; /* mark as unavailable to zr36057 */ | 1066 | zr->stat_com[j] = 1; /* mark as unavailable to zr36057 */ |
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c index 15283f44e79f..485553be190b 100644 --- a/drivers/media/video/zoran_driver.c +++ b/drivers/media/video/zoran_driver.c | |||
@@ -1345,7 +1345,7 @@ zoran_open (struct inode *inode, | |||
1345 | ZR_DEVNAME(zr), current->comm, current->pid, zr->user); | 1345 | ZR_DEVNAME(zr), current->comm, current->pid, zr->user); |
1346 | 1346 | ||
1347 | /* now, create the open()-specific file_ops struct */ | 1347 | /* now, create the open()-specific file_ops struct */ |
1348 | fh = kmalloc(sizeof(struct zoran_fh), GFP_KERNEL); | 1348 | fh = kzalloc(sizeof(struct zoran_fh), GFP_KERNEL); |
1349 | if (!fh) { | 1349 | if (!fh) { |
1350 | dprintk(1, | 1350 | dprintk(1, |
1351 | KERN_ERR | 1351 | KERN_ERR |
@@ -1354,7 +1354,6 @@ zoran_open (struct inode *inode, | |||
1354 | res = -ENOMEM; | 1354 | res = -ENOMEM; |
1355 | goto open_unlock_and_return; | 1355 | goto open_unlock_and_return; |
1356 | } | 1356 | } |
1357 | memset(fh, 0, sizeof(struct zoran_fh)); | ||
1358 | /* used to be BUZ_MAX_WIDTH/HEIGHT, but that gives overflows | 1357 | /* used to be BUZ_MAX_WIDTH/HEIGHT, but that gives overflows |
1359 | * on norm-change! */ | 1358 | * on norm-change! */ |
1360 | fh->overlay_mask = | 1359 | fh->overlay_mask = |
diff --git a/drivers/media/video/zr36016.c b/drivers/media/video/zr36016.c index 4ed898585c70..10130ef67ea7 100644 --- a/drivers/media/video/zr36016.c +++ b/drivers/media/video/zr36016.c | |||
@@ -451,12 +451,11 @@ zr36016_setup (struct videocodec *codec) | |||
451 | return -ENOSPC; | 451 | return -ENOSPC; |
452 | } | 452 | } |
453 | //mem structure init | 453 | //mem structure init |
454 | codec->data = ptr = kmalloc(sizeof(struct zr36016), GFP_KERNEL); | 454 | codec->data = ptr = kzalloc(sizeof(struct zr36016), GFP_KERNEL); |
455 | if (NULL == ptr) { | 455 | if (NULL == ptr) { |
456 | dprintk(1, KERN_ERR "zr36016: Can't get enough memory!\n"); | 456 | dprintk(1, KERN_ERR "zr36016: Can't get enough memory!\n"); |
457 | return -ENOMEM; | 457 | return -ENOMEM; |
458 | } | 458 | } |
459 | memset(ptr, 0, sizeof(struct zr36016)); | ||
460 | 459 | ||
461 | snprintf(ptr->name, sizeof(ptr->name), "zr36016[%d]", | 460 | snprintf(ptr->name, sizeof(ptr->name), "zr36016[%d]", |
462 | zr36016_codecs); | 461 | zr36016_codecs); |
diff --git a/drivers/media/video/zr36050.c b/drivers/media/video/zr36050.c index 0144576a6123..bd0cd28543ca 100644 --- a/drivers/media/video/zr36050.c +++ b/drivers/media/video/zr36050.c | |||
@@ -813,12 +813,11 @@ zr36050_setup (struct videocodec *codec) | |||
813 | return -ENOSPC; | 813 | return -ENOSPC; |
814 | } | 814 | } |
815 | //mem structure init | 815 | //mem structure init |
816 | codec->data = ptr = kmalloc(sizeof(struct zr36050), GFP_KERNEL); | 816 | codec->data = ptr = kzalloc(sizeof(struct zr36050), GFP_KERNEL); |
817 | if (NULL == ptr) { | 817 | if (NULL == ptr) { |
818 | dprintk(1, KERN_ERR "zr36050: Can't get enough memory!\n"); | 818 | dprintk(1, KERN_ERR "zr36050: Can't get enough memory!\n"); |
819 | return -ENOMEM; | 819 | return -ENOMEM; |
820 | } | 820 | } |
821 | memset(ptr, 0, sizeof(struct zr36050)); | ||
822 | 821 | ||
823 | snprintf(ptr->name, sizeof(ptr->name), "zr36050[%d]", | 822 | snprintf(ptr->name, sizeof(ptr->name), "zr36050[%d]", |
824 | zr36050_codecs); | 823 | zr36050_codecs); |
diff --git a/drivers/media/video/zr36060.c b/drivers/media/video/zr36060.c index 129744a07abd..28fa31a5f150 100644 --- a/drivers/media/video/zr36060.c +++ b/drivers/media/video/zr36060.c | |||
@@ -919,12 +919,11 @@ zr36060_setup (struct videocodec *codec) | |||
919 | return -ENOSPC; | 919 | return -ENOSPC; |
920 | } | 920 | } |
921 | //mem structure init | 921 | //mem structure init |
922 | codec->data = ptr = kmalloc(sizeof(struct zr36060), GFP_KERNEL); | 922 | codec->data = ptr = kzalloc(sizeof(struct zr36060), GFP_KERNEL); |
923 | if (NULL == ptr) { | 923 | if (NULL == ptr) { |
924 | dprintk(1, KERN_ERR "zr36060: Can't get enough memory!\n"); | 924 | dprintk(1, KERN_ERR "zr36060: Can't get enough memory!\n"); |
925 | return -ENOMEM; | 925 | return -ENOMEM; |
926 | } | 926 | } |
927 | memset(ptr, 0, sizeof(struct zr36060)); | ||
928 | 927 | ||
929 | snprintf(ptr->name, sizeof(ptr->name), "zr36060[%d]", | 928 | snprintf(ptr->name, sizeof(ptr->name), "zr36060[%d]", |
930 | zr36060_codecs); | 929 | zr36060_codecs); |