aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/int340x_thermal/acpi_thermal_rel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/int340x_thermal/acpi_thermal_rel.c')
-rw-r--r--drivers/thermal/int340x_thermal/acpi_thermal_rel.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/thermal/int340x_thermal/acpi_thermal_rel.c b/drivers/thermal/int340x_thermal/acpi_thermal_rel.c
index 0d8db808f0ae..e4e61b3fb11e 100644
--- a/drivers/thermal/int340x_thermal/acpi_thermal_rel.c
+++ b/drivers/thermal/int340x_thermal/acpi_thermal_rel.c
@@ -131,6 +131,8 @@ int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trtp,
131 pr_warn("Failed to get target ACPI device\n"); 131 pr_warn("Failed to get target ACPI device\n");
132 } 132 }
133 133
134 result = 0;
135
134 *trtp = trts; 136 *trtp = trts;
135 /* don't count bad entries */ 137 /* don't count bad entries */
136 *trt_count -= nr_bad_entries; 138 *trt_count -= nr_bad_entries;
@@ -317,21 +319,21 @@ static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd,
317{ 319{
318 int ret = 0; 320 int ret = 0;
319 unsigned long length = 0; 321 unsigned long length = 0;
320 unsigned long count = 0; 322 int count = 0;
321 char __user *arg = (void __user *)__arg; 323 char __user *arg = (void __user *)__arg;
322 struct trt *trts; 324 struct trt *trts;
323 struct art *arts; 325 struct art *arts;
324 326
325 switch (cmd) { 327 switch (cmd) {
326 case ACPI_THERMAL_GET_TRT_COUNT: 328 case ACPI_THERMAL_GET_TRT_COUNT:
327 ret = acpi_parse_trt(acpi_thermal_rel_handle, (int *)&count, 329 ret = acpi_parse_trt(acpi_thermal_rel_handle, &count,
328 &trts, false); 330 &trts, false);
329 kfree(trts); 331 kfree(trts);
330 if (!ret) 332 if (!ret)
331 return put_user(count, (unsigned long __user *)__arg); 333 return put_user(count, (unsigned long __user *)__arg);
332 return ret; 334 return ret;
333 case ACPI_THERMAL_GET_TRT_LEN: 335 case ACPI_THERMAL_GET_TRT_LEN:
334 ret = acpi_parse_trt(acpi_thermal_rel_handle, (int *)&count, 336 ret = acpi_parse_trt(acpi_thermal_rel_handle, &count,
335 &trts, false); 337 &trts, false);
336 kfree(trts); 338 kfree(trts);
337 length = count * sizeof(union trt_object); 339 length = count * sizeof(union trt_object);
@@ -341,14 +343,14 @@ static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd,
341 case ACPI_THERMAL_GET_TRT: 343 case ACPI_THERMAL_GET_TRT:
342 return fill_trt(arg); 344 return fill_trt(arg);
343 case ACPI_THERMAL_GET_ART_COUNT: 345 case ACPI_THERMAL_GET_ART_COUNT:
344 ret = acpi_parse_art(acpi_thermal_rel_handle, (int *)&count, 346 ret = acpi_parse_art(acpi_thermal_rel_handle, &count,
345 &arts, false); 347 &arts, false);
346 kfree(arts); 348 kfree(arts);
347 if (!ret) 349 if (!ret)
348 return put_user(count, (unsigned long __user *)__arg); 350 return put_user(count, (unsigned long __user *)__arg);
349 return ret; 351 return ret;
350 case ACPI_THERMAL_GET_ART_LEN: 352 case ACPI_THERMAL_GET_ART_LEN:
351 ret = acpi_parse_art(acpi_thermal_rel_handle, (int *)&count, 353 ret = acpi_parse_art(acpi_thermal_rel_handle, &count,
352 &arts, false); 354 &arts, false);
353 kfree(arts); 355 kfree(arts);
354 length = count * sizeof(union art_object); 356 length = count * sizeof(union art_object);