aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/vpx3220.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/vpx3220.c')
-rw-r--r--drivers/media/video/vpx3220.c7
1 files changed, 2 insertions, 5 deletions
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;