Skip to content

Commit f1b930e

Browse files
error27rafaeljw
authored andcommitted
thermal: intel: quark_dts: fix error pointer dereference
If alloc_soc_dts() fails, then we can just return. Trying to free "soc_dts" will lead to an Oops. Fixes: 8c18769 ("thermal: intel Quark SoC X1000 DTS thermal driver") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 1b72607 commit f1b930e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

drivers/thermal/intel/intel_quark_dts_thermal.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -400,22 +400,14 @@ MODULE_DEVICE_TABLE(x86cpu, qrk_thermal_ids);
400400

401401
static int __init intel_quark_thermal_init(void)
402402
{
403-
int err = 0;
404-
405403
if (!x86_match_cpu(qrk_thermal_ids) || !iosf_mbi_available())
406404
return -ENODEV;
407405

408406
soc_dts = alloc_soc_dts();
409-
if (IS_ERR(soc_dts)) {
410-
err = PTR_ERR(soc_dts);
411-
goto err_free;
412-
}
407+
if (IS_ERR(soc_dts))
408+
return PTR_ERR(soc_dts);
413409

414410
return 0;
415-
416-
err_free:
417-
free_soc_dts(soc_dts);
418-
return err;
419411
}
420412

421413
static void __exit intel_quark_thermal_exit(void)

0 commit comments

Comments
 (0)