File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -1218,7 +1218,7 @@ static int acpi_battery_add(struct acpi_device *device)
1218
1218
if (device -> dep_unmet )
1219
1219
return - EPROBE_DEFER ;
1220
1220
1221
- battery = kzalloc ( sizeof (struct acpi_battery ), GFP_KERNEL );
1221
+ battery = devm_kzalloc ( & device -> dev , sizeof (* battery ), GFP_KERNEL );
1222
1222
if (!battery )
1223
1223
return - ENOMEM ;
1224
1224
battery -> device = device ;
@@ -1258,7 +1258,6 @@ static int acpi_battery_add(struct acpi_device *device)
1258
1258
sysfs_remove_battery (battery );
1259
1259
mutex_destroy (& battery -> lock );
1260
1260
mutex_destroy (& battery -> sysfs_lock );
1261
- kfree (battery );
1262
1261
1263
1262
return result ;
1264
1263
}
@@ -1281,7 +1280,6 @@ static void acpi_battery_remove(struct acpi_device *device)
1281
1280
1282
1281
mutex_destroy (& battery -> lock );
1283
1282
mutex_destroy (& battery -> sysfs_lock );
1284
- kfree (battery );
1285
1283
}
1286
1284
1287
1285
#ifdef CONFIG_PM_SLEEP
You can’t perform that action at this time.
0 commit comments