diff options
Diffstat (limited to 'drivers/i2c/chips/max6875.c')
-rw-r--r-- | drivers/i2c/chips/max6875.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c index 9e1aeb69abf9..b376a006883c 100644 --- a/drivers/i2c/chips/max6875.c +++ b/drivers/i2c/chips/max6875.c | |||
@@ -179,16 +179,14 @@ static int max6875_detect(struct i2c_adapter *adapter, int address, int kind) | |||
179 | if (address & 1) | 179 | if (address & 1) |
180 | return 0; | 180 | return 0; |
181 | 181 | ||
182 | if (!(data = kmalloc(sizeof(struct max6875_data), GFP_KERNEL))) | 182 | if (!(data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL))) |
183 | return -ENOMEM; | 183 | return -ENOMEM; |
184 | memset(data, 0, sizeof(struct max6875_data)); | ||
185 | 184 | ||
186 | /* A fake client is created on the odd address */ | 185 | /* A fake client is created on the odd address */ |
187 | if (!(fake_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL))) { | 186 | if (!(fake_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL))) { |
188 | err = -ENOMEM; | 187 | err = -ENOMEM; |
189 | goto exit_kfree1; | 188 | goto exit_kfree1; |
190 | } | 189 | } |
191 | memset(fake_client, 0, sizeof(struct i2c_client)); | ||
192 | 190 | ||
193 | /* Init real i2c_client */ | 191 | /* Init real i2c_client */ |
194 | real_client = &data->client; | 192 | real_client = &data->client; |