diff options
Diffstat (limited to 'drivers/media/video/bt856.c')
-rw-r--r-- | drivers/media/video/bt856.c | 6 |
1 files changed, 2 insertions, 4 deletions
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); |