Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90fe17f4 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Len Brown
Browse files

thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed

parent a815ab8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5826,7 +5826,7 @@ static void __init get_thinkpad_model_data(struct thinkpad_id_data *tp)

	tp->model_str = kstrdup(dmi_get_system_info(DMI_PRODUCT_VERSION),
					GFP_KERNEL);
	if (strnicmp(tp->model_str, "ThinkPad", 8) != 0) {
	if (tp->model_str && strnicmp(tp->model_str, "ThinkPad", 8) != 0) {
		kfree(tp->model_str);
		tp->model_str = NULL;
	}