Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1192950lqt; Fri, 7 Jun 2024 10:27:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUlXGnDz0+beQokXhXrs9PEWgPtMmwwpP46VKyFnmdcUui3qG8NHoF7xL0zvb146j/Dbc7VA/16uujdMAZn7V2VQXcwgm0iL/HCJDtX8Q== X-Google-Smtp-Source: AGHT+IFqHem6CVwsKYYOLdRi9UKo5dgPjyKtBl2/9KY0f2hptFs4jsf/+Bl24LoJPuiskYvdUIMI X-Received: by 2002:a05:6a20:96d8:b0:1b2:a346:6c8a with SMTP id adf61e73a8af0-1b2f9dee1c5mr2803917637.54.1717781267307; Fri, 07 Jun 2024 10:27:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717781267; cv=pass; d=google.com; s=arc-20160816; b=NoebkwKAvpvXsWlhxwVHHbfzJclsIRKG10kV+/l9mIOW9YrUNiA4oe4IXOoEBDRlWP jZiDt1HHGZ+20fjuwfnL0Fw83NGcBbRUXzPTvoKbqftrOMZjgGlW/tI1V+0PxcXxhdZ+ nM55PBQjX+UbfwV27aNJ8ynHcSxzkErL4kkz1V5FMCLmzYTeCT9POULlDY6MkASS8G/w lCGU0NymGIhS+c8WpOxgxreaefOtc/MWmlqsY2K5wFBmZ+xMkll3KZW8dXP+QZcOSPY2 vkpBy5GHFaKhY6MBlIDJC8DKWMQUVLIuLmny8GNHGIp7BdolirTPPyMoSKeg8XdAG2UW T89A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:subject :references:in-reply-to:cc:to:from:dkim-signature; bh=XcHsiIXP92MVgDB9ChhIEv6qmKeznza12oVo5QLme9U=; fh=KhIupkDiqmxOhpwIyPFGzv0/xPn/7NnIgLLqb1hKeP8=; b=eFSC0R3mSUndCi4vXPpvmpVBIPguCEX0kQ5b+14rEW43LTYBQlNKSx+Id93l4qiGGk L+qmUqs4PFF1DVMDYEK3b3yYTSqg80TgA5vRShecHDdoA+tpimanwMj4tcB24jIawwZg 5m44qcLm3LYxa/o2n6A0G9egluzAH9fNPWc5QUM4PsxQErLwk4fgWEdzP/I1JR2iRLg1 UvEsd+NXEjo0u8hD9/ydFY/ARJg2qhETsLI9lU+i1CSOC+Ds1oA6QxLZaGuHzQpiwnUo Fm/3a/ZWn7dG//HICwMxpvB0N9MD8wUu/unp2s0mvtAyhBQqNlE8rq0d+DCTOGfqVf8q g/fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IbNHu0uU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-206122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206122-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd3b39ccsi824856b3a.139.2024.06.07.10.27.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 10:27:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IbNHu0uU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-206122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206122-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7E74EB22F46 for ; Fri, 7 Jun 2024 13:23:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5383A194093; Fri, 7 Jun 2024 13:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IbNHu0uU" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8F2E15DBC1; Fri, 7 Jun 2024 13:22:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717766574; cv=none; b=pmuskYLnt14vC8+wQlVwGPeePiN/ypd3kh1NIAca2gHtSmJyDmeFHGP1ta50qQNIQiZuPjzmc/KirioBYc1t+/XsqAzl6O6JL8oIOLQ5i5t/bxMK698/JhXieCxjtvgd5881Z6ko7vYngszohFKFYwe6VuIkZ6R3pWhNgVGewqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717766574; c=relaxed/simple; bh=HA7k21McxCzM1Wd5tina4b9xJX2yCPad3KU7yAY27LI=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=TRL1l4YR09UnyfNQtnG2it70wL8fFVJcryq61HCIzOIMSMZhjsa9W5sL7g5cpJV3GIqF22BvreyV54NQCjBTSGJvEONTUuQ9Ncu+4YFgvO+D2dWBCxyhe2q0/6xn5RojsA+BzWGsU212U1/QnJnbfl+rqcVbVtm/Vwi4bbdrxgI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IbNHu0uU; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717766572; x=1749302572; h=from:to:cc:in-reply-to:references:subject:message-id: date:mime-version:content-transfer-encoding; bh=HA7k21McxCzM1Wd5tina4b9xJX2yCPad3KU7yAY27LI=; b=IbNHu0uU4aStn8jEiJQK9gVfngAuBh3xBF7JMLc6fWHySlBmBLC0tSDY sT2jeLV9NyY8ZoCYGkZ6Ql8+XMI/2HrOqYG5DWsziA9FmG2BhJ/UPRrme oHBI+Bl5KC7slVICRJEKVfPqXML7lTexlWxSaGjEJ9jPEh6e7hz5iq1lD 8gHY7UlmiZeq0dNlYxg0jguTn7+VfNQx/Zbo7jZ4E50QNa2yYN8+CNCOA vIeaIJp5RCGZUdw7GHByXU8FK5Zbau+r464IrIS79xwtQp360qtgg21B2 /+ccr2YL896LVuB6QXYUPppZK726eVjGKTEdraKKZk4+DmxjFWlAGUFLp g==; X-CSE-ConnectionGUID: G4NkuM9IT4u/Ni/22LDVgA== X-CSE-MsgGUID: /MwOVzQbR7eZW+FJwnEi2Q== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14290983" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14290983" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:22:52 -0700 X-CSE-ConnectionGUID: KIY+D643RKSGlC9J2katxA== X-CSE-MsgGUID: qkTb7GKBRJqJFt9ioBHCtg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="42741001" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.184]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:22:50 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: Lyndon Sanche , Hans de Goede , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240604-dell-pc-double-free-v1-1-6d81255b2a44@weissschuh.net> References: <20240604-dell-pc-double-free-v1-1-6d81255b2a44@weissschuh.net> Subject: Re: [PATCH] platform/x86: dell-pc: avoid double free and invalid unregistration Message-Id: <171776656561.2612.17760986388744096307.b4-ty@linux.intel.com> Date: Fri, 07 Jun 2024 16:22:45 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailer: b4 0.13.0 On Tue, 04 Jun 2024 23:41:24 +0200, Thomas Weißschuh wrote: > If platform_profile_register() fails it does kfree(thermal_handler) and > leaves the pointer value around. > Any call to thermal_cleanup() will try to kfree(thermal_handler) again. > This will happen right away in dell_init(). > In addition, platform_profile_remove() will be called although no > profile is registered. > > [...] Thank you for your contribution, it has been applied to my local review-ilpo branch. Note it will show up in the public platform-drivers-x86/review-ilpo branch only once I've pushed my local branch there, which might take a while. The list of commits applied: [1/1] platform/x86: dell-pc: avoid double free and invalid unregistration commit: dd637f5cd5f334d2d014872544470031415cec3b -- i.