From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796224438; b=lV7uH7kAhwgHoJqkI85VTgDXcBmlNeQtiHcRaGjTifJ4o04H00Us5aySabhZrmq3Swex E4H6Z2eqNmxIht0bTezEHsoSl2RIo3Zl0T43PVI1e/RfetzxvWxv5vWDXcriaik4ybZLc zPpRY/+01CM6vVbFOXvWt0OtLuAQG6bEQQcxYzkObLuIgS+zTpRG+BTXAXzI+7tWc+feC kvkEnognRa8kIeOFz4hxTR9PbgKUumbb/wLJY/XJb4kBRJxDtQmr/csAwSNu/y/LGIc8l 6hvRS54fqZnNrB9rtSs7kR6Iu3oNRKbuQRcP7ixtP6EposqTTmQw2aL1+9dsCmFfAXA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796224438; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=lhB2mPOJpr9qOyCtjmBZarVDa3qfkw6P930d7idSsN0=; b=RzuDefDN9EE4Xcf8ks4+OvMJa5smMlwH1JIEGX2CtUuWjm+lcmov3G1grGCNfaZgr3va uce5J1S2fiZQESjuPhYsNj7PD0eQK09wb9A+giE1ZNt3dyF+UMSyH4vvqJztYzUnnbG/1 nQk/wkm9SkL7FCQChJ9V8uYbTnjCMLPOqfeJ0UmnNjB7ONr1o2cRajCqdxhD7RBP5/kG4 N1RNAw0YelWsA3ii2nDFsTTkJ49dnxD4yKuSq2XoShL2e5De3bWjh+LqxmuJkwdMXAQ9X 2Hqof3cYWbPBvgz8LisF66UXQ8eBXEQKIdG6DujwZqSYVMfp7DSxv7jdDd887vav90w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rfP4hcqM; arc=none smtp.remote-ip=209.85.208.42 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C2F2606A332 for ; Wed, 2 Dec 2026 15:13:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3C2F2606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rfP4hcqM Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-6b88d143160so15448964a12.1 for ; Wed, 02 Dec 2026 07:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796224437; x=1796829237; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lhB2mPOJpr9qOyCtjmBZarVDa3qfkw6P930d7idSsN0=; b=rfP4hcqM8d208bqI4FfH5uiwPxNSPN9SZGG1ep6VzCwbdH9G5VU6KqXee7zf/bdt2F jduz3Q8tQdGEQbQs0hAnce6RHUgk7WPp2wTvOslO5kikT6jycaSXgZr7C+97kRUUjw50 YlwIDj2pBO2IRv6Mw8z7p98da36XO9UbJMcUVUdeOGYheNVyWByH/b/+Ze2so+2K+MUr 7bAx/dEGGojTEIUF8f+s4U7aQlTGvRLUGMVBzgkcyMWPdfSSkH0VFejGQVgX9mlwJ0yf CMIM3BlxbRqB7zEk+DF4BHStDxDatNPf7mH9lgLh/w/7NsKtn1b5GoYAeh3sQg19HGzY LoQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796224437; x=1796829237; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lhB2mPOJpr9qOyCtjmBZarVDa3qfkw6P930d7idSsN0=; b=Fez3lwZP1DlXr2OxVVRn1W2vwLUyF4pFVTzqlvQ7K8FGI6LT/jJo/bo3t1Y4mADxO9 hOlZK8NeQ2hiDIJZMURsjOyHpyilZ03nANABy++h5TsHib7d5TxDOSysHAL/WAF0tsiC BQYXgpSOgS68G9d1dnN5v6AkXmodF2Deu5JkQdvL97pwxgGcUTCNSmMq3gt2irPbUaQP VLDTgm/oMC2i1q+4jmDB34zYSbJTA/ObDt+S3OxxrKpqN8q05PPtFOeqtmczaffpL7sO 5Agu9Gcg4paN/iWFdzw0DWfGwCvP+SMNxqgZrj/QdqfzPWSF9V/f+1iU/pG2j615aFDj 6CHw== X-Gm-Message-State: APuU4Z/LJjra1Aei5dbXUCCsgkVeRVbYLRubjyRfoClNhbXORgwxevmk vECCGnWsYJODJlHmrCKMJr/GxImdwLWqMA4V0rWWrTbkXxTjFP+TAGcc X-Gm-Gg: AZFdTZd0EZBMPrnRqFQX5gljbXIGYUcGxKfFKBdXahyD7UQsSGfmY/VNqdIVzef8bAa mqY+T0jFvomYH7nC9koG4gRthtjmB5Yen+lYfjIA8m2b8QllHcsFTUp+s3B/cCFWUXU6N8V9caO M+eghbyK82im1LIQHtLU/TdSQsOfbCnf0LnIEMWdsplmWfYFANSiuOYLJwPQ01AxtIEPujmMOC0 bMCylSb+EiYk6G8c+Iry8sY2BR8+3P4V3e8gZYWdlCBpLQN3Y0UiFukKlvVLuGsLEa+50+aGIQ7 Cngp0mYPRn8zQL8W5BD0Qr4V+0qQK4K8neX6A+cF4D632sMudw4LrFdPrR7HU++smZv/V7YQuqz PAK9zUdwu7QPoftpykMAk6fmRODiMLPBxDQ/ydQAwVh3NfNm9sH1nZ49tmXkLpc4MwWZeYcojiM Qgon+ABRBhRZFaLCGZ4fA5lfbM6ypwNJBkAZtAeeeO8DNSh1x52L6jmK2Pt85GFgGkWCyypcgTF j2aLGxycgkQpQYwG+O8F9CfVn7xenj/AB/4nmRXayvKeQC8q5wYcIM8MKgQ5vdTXlL3CSAQhjMS +R3OGHUVqsmxSZAZPDK4BSHdJQ7H X-Received: by 2002:a05:6402:1941:b0:6ba:7b46:7885 with SMTP id 4fb4d7f45d1cf-6ba7b468283mr24347251a12.11.1796224436326; Wed, 02 Dec 2026 07:13:56 -0800 (PST) Received: from [10.10.0.155] ([85.105.252.11]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6ba7b9570e9sm14864449a12.36.2026.12.02.07.13.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 07:13:56 -0800 (PST) Message-ID: Date: Wed, 2 Dec 2026 18:13:51 +0300 X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] platform/asus: asus-wmi: Use __free(kfree) in asus_wmi_evaluate_method_buf() To: Denis Benato , Corentin Chary , "Luke D. Jones" , Hans de Goede , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261202-asus-wmi-eval-buf-v1-0-640c12d437dc@gmail.com> <20261202-asus-wmi-eval-buf-v1-2-640c12d437dc@gmail.com> Content-Language: en-US From: Bartu Alev In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/2/26 5:45 AM, Denis Benato wrote: > obj was assigned here, you moved it up but I can't see any reason for that, > in fact moving it up only increase the possibility of an allocation immediately > freed due to an error (like the return -EIO). > > Move the obj __free line here. __free(kfree) does not allocate anything and is a no-op when output.pointer is NULL. The reason I placed it before the ACPI_FAILURE(status) check is an ACPICA quirk in drivers/acpi/acpica/nsxfeval.c: acpi_evaluate_object() calls acpi_ut_initialize_buffer() (allocating return_buffer->pointer) before acpi_ut_copy_iobject_to_eobject(). If copying fails with AE_TYPE or AE_SUPPORT, acpi_evaluate_object() goes to cleanup_return_object without freeing return_buffer->pointer, so output.pointer can be non-NULL on an error return. That said, if you and Ilpo prefer placing the __free(kfree) declaration after the ACPI_FAILURE(status) check, i am move it down in v2. > > Yeah... I think that this should be patch 1, but Ilpo might have > a different opinion... At the same time 8 lines changes in two > patches where half of the first patch gets dropped on the second > looks like a bit of an overkill to me. >