mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 09:44:18 +08:00
V4L/DVB (5953): msp3400-driver.c: kmalloc + memset conversion to kzalloc
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
3873dd0414
commit
b2a657603e
@ -813,8 +813,9 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
|
||||
int msp_rom;
|
||||
|
||||
client = kzalloc(sizeof(*client), GFP_KERNEL);
|
||||
if (client == NULL)
|
||||
if (!client)
|
||||
return -ENOMEM;
|
||||
|
||||
client->addr = address;
|
||||
client->adapter = adapter;
|
||||
client->driver = &i2c_driver;
|
||||
@ -826,14 +827,14 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
|
||||
return 0;
|
||||
}
|
||||
|
||||
state = kmalloc(sizeof(*state), GFP_KERNEL);
|
||||
if (state == NULL) {
|
||||
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
||||
if (!state) {
|
||||
kfree(client);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
i2c_set_clientdata(client, state);
|
||||
|
||||
memset(state, 0, sizeof(*state));
|
||||
state->v4l2_std = V4L2_STD_NTSC;
|
||||
state->audmode = V4L2_TUNER_MODE_STEREO;
|
||||
state->volume = 58880; /* 0db gain */
|
||||
|
Loading…
Reference in New Issue
Block a user