diff options
-rw-r--r-- | drivers/hwmon/asc7621.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hwmon/asc7621.c b/drivers/hwmon/asc7621.c index 7caa242915a6..b867aab78049 100644 --- a/drivers/hwmon/asc7621.c +++ b/drivers/hwmon/asc7621.c | |||
@@ -1109,7 +1109,8 @@ asc7621_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1109 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 1109 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
1110 | return -EIO; | 1110 | return -EIO; |
1111 | 1111 | ||
1112 | data = kzalloc(sizeof(struct asc7621_data), GFP_KERNEL); | 1112 | data = devm_kzalloc(&client->dev, sizeof(struct asc7621_data), |
1113 | GFP_KERNEL); | ||
1113 | if (data == NULL) | 1114 | if (data == NULL) |
1114 | return -ENOMEM; | 1115 | return -ENOMEM; |
1115 | 1116 | ||
@@ -1143,7 +1144,6 @@ exit_remove: | |||
1143 | &(asc7621_params[i].sda.dev_attr)); | 1144 | &(asc7621_params[i].sda.dev_attr)); |
1144 | } | 1145 | } |
1145 | 1146 | ||
1146 | kfree(data); | ||
1147 | return err; | 1147 | return err; |
1148 | } | 1148 | } |
1149 | 1149 | ||
@@ -1192,7 +1192,6 @@ static int asc7621_remove(struct i2c_client *client) | |||
1192 | &(asc7621_params[i].sda.dev_attr)); | 1192 | &(asc7621_params[i].sda.dev_attr)); |
1193 | } | 1193 | } |
1194 | 1194 | ||
1195 | kfree(data); | ||
1196 | return 0; | 1195 | return 0; |
1197 | } | 1196 | } |
1198 | 1197 | ||