diff options
Diffstat (limited to 'drivers/hwmon/w83792d.c')
-rw-r--r-- | drivers/hwmon/w83792d.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c index 7bbd1888ce94..4be59dbb78c4 100644 --- a/drivers/hwmon/w83792d.c +++ b/drivers/hwmon/w83792d.c | |||
@@ -1086,11 +1086,10 @@ w83792d_create_subclient(struct i2c_adapter *adapter, | |||
1086 | int err; | 1086 | int err; |
1087 | struct i2c_client *sub_client; | 1087 | struct i2c_client *sub_client; |
1088 | 1088 | ||
1089 | (*sub_cli) = sub_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 1089 | (*sub_cli) = sub_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
1090 | if (!(sub_client)) { | 1090 | if (!(sub_client)) { |
1091 | return -ENOMEM; | 1091 | return -ENOMEM; |
1092 | } | 1092 | } |
1093 | memset(sub_client, 0x00, sizeof(struct i2c_client)); | ||
1094 | sub_client->addr = 0x48 + addr; | 1093 | sub_client->addr = 0x48 + addr; |
1095 | i2c_set_clientdata(sub_client, NULL); | 1094 | i2c_set_clientdata(sub_client, NULL); |
1096 | sub_client->adapter = adapter; | 1095 | sub_client->adapter = adapter; |
@@ -1184,11 +1183,10 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1184 | client structure, even though we cannot fill it completely yet. | 1183 | client structure, even though we cannot fill it completely yet. |
1185 | But it allows us to access w83792d_{read,write}_value. */ | 1184 | But it allows us to access w83792d_{read,write}_value. */ |
1186 | 1185 | ||
1187 | if (!(data = kmalloc(sizeof(struct w83792d_data), GFP_KERNEL))) { | 1186 | if (!(data = kzalloc(sizeof(struct w83792d_data), GFP_KERNEL))) { |
1188 | err = -ENOMEM; | 1187 | err = -ENOMEM; |
1189 | goto ERROR0; | 1188 | goto ERROR0; |
1190 | } | 1189 | } |
1191 | memset(data, 0, sizeof(struct w83792d_data)); | ||
1192 | 1190 | ||
1193 | new_client = &data->client; | 1191 | new_client = &data->client; |
1194 | i2c_set_clientdata(new_client, data); | 1192 | i2c_set_clientdata(new_client, data); |