diff options
Diffstat (limited to 'drivers/media/video/msp3400-driver.c')
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index 11cfcf18ec34..e9d400e19a5d 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -813,8 +813,9 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) | |||
813 | int msp_rom; | 813 | int msp_rom; |
814 | 814 | ||
815 | client = kzalloc(sizeof(*client), GFP_KERNEL); | 815 | client = kzalloc(sizeof(*client), GFP_KERNEL); |
816 | if (client == NULL) | 816 | if (!client) |
817 | return -ENOMEM; | 817 | return -ENOMEM; |
818 | |||
818 | client->addr = address; | 819 | client->addr = address; |
819 | client->adapter = adapter; | 820 | client->adapter = adapter; |
820 | client->driver = &i2c_driver; | 821 | client->driver = &i2c_driver; |
@@ -826,14 +827,14 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) | |||
826 | return 0; | 827 | return 0; |
827 | } | 828 | } |
828 | 829 | ||
829 | state = kmalloc(sizeof(*state), GFP_KERNEL); | 830 | state = kzalloc(sizeof(*state), GFP_KERNEL); |
830 | if (state == NULL) { | 831 | if (!state) { |
831 | kfree(client); | 832 | kfree(client); |
832 | return -ENOMEM; | 833 | return -ENOMEM; |
833 | } | 834 | } |
835 | |||
834 | i2c_set_clientdata(client, state); | 836 | i2c_set_clientdata(client, state); |
835 | 837 | ||
836 | memset(state, 0, sizeof(*state)); | ||
837 | state->v4l2_std = V4L2_STD_NTSC; | 838 | state->v4l2_std = V4L2_STD_NTSC; |
838 | state->audmode = V4L2_TUNER_MODE_STEREO; | 839 | state->audmode = V4L2_TUNER_MODE_STEREO; |
839 | state->volume = 58880; /* 0db gain */ | 840 | state->volume = 58880; /* 0db gain */ |