From patchwork Thu Mar 24 19:09:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davidlohr Bueso X-Patchwork-Id: 553975 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AF05C4332F for ; Thu, 24 Mar 2022 19:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352848AbiCXTLv (ORCPT ); Thu, 24 Mar 2022 15:11:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243953AbiCXTLu (ORCPT ); Thu, 24 Mar 2022 15:11:50 -0400 Received: from beige.elm.relay.mailchannels.net (beige.elm.relay.mailchannels.net [23.83.212.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D42A9B82D8; Thu, 24 Mar 2022 12:10:16 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A9FB32A2F4A; Thu, 24 Mar 2022 19:10:13 +0000 (UTC) Received: from pdx1-sub0-mail-a219.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E27C62A2D14; Thu, 24 Mar 2022 19:10:12 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1648149013; a=rsa-sha256; cv=none; b=ikrL/FRlJrmDSdm8eK6R9vC8KwT8dU1cgNagVULJ6ssIp2iT29Rp1rxSyeNm4P+ivUpLGN x6i+K9EkdinWxfyATJYjygU0n8QwdBgLuVeqR74eNIJyt2sYSXUbVfDjHpPbI/5BIppPXX fNezTnQWDWltaEPj53kh1hZFpGg52iy1BnauMdOf+c4b4t/Wv0IuFpx8X98BdgCUTCVkl/ Kzg0bMo04K05bV/vXufNRRUPolg9826CKnu5ZK40+DYAQAwf/3heWugOqNdmitPeZnCyFB zoTp58LVi64SlbFHvDIMmRYvxD7gh1wxtivKJE4m+SQGZSNEXgkTHwOYq1bwSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1648149013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Ung/rILZ29OpCBmyEd160HryqWv0UQx2teHkWsgSM38=; b=vd50b15dwiUpw7EQVVzkwKHgGxFl6AHuSNJ/G2qUGGB1Gym+iCbznvkK0yvGWuGfpY7do3 DtrnfLvQYAIz2QBgVA+UE+URIy+Mj130Uvi/CzZc+K9vTzIk27D/UaNxqrOSGqvpf/9VeD Z/Kfu2VKYquu96QOr6myWS4Kvml9W5mXwjljCnCR609DWakkpuGPMhttCxQXEjq6wb5nxU /e6DKn1ri6x0YX3OZ5nttkAKZFQdW6u+4asAIsewIefm+E6lM0pAWuJlLju6go3a19Ob28 dw8Dp/8AjAkvlIO5rwj8BygLms8G48j1r4sbafhUaOnceCERXEp9/WVcV3eKAA== ARC-Authentication-Results: i=1; rspamd-7b6f4d8d7c-ktks5; auth=pass smtp.auth=dreamhost smtp.mailfrom=dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from pdx1-sub0-mail-a219.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.107.255.147 (trex/6.5.3); Thu, 24 Mar 2022 19:10:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Spill-Quick: 7398b87717486304_1648149013455_3469798804 X-MC-Loop-Signature: 1648149013455:3057219792 X-MC-Ingress-Time: 1648149013455 Received: from localhost.localdomain (unknown [104.36.25.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a219.dreamhost.com (Postfix) with ESMTPSA id 4KPZYF46G5z47; Thu, 24 Mar 2022 12:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1648149012; bh=Ung/rILZ29OpCBmyEd160HryqWv0UQx2teHkWsgSM38=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=htxnRqLBpOT5aON8j9qGAFa3WdpANECm4YVDV86rUH19UHc34hss4a/GOLtVZGDHf iT30v9iBTk3Bj6HYWGanPooDbESSkuAJpmtwwdVuR/GLposKL0HBcMpR90iWMdb8Zg n3GtBxgyDM6LGTF6W55fWoq/wH8gMMXOq7plx4P+pAy+hgO+GCiSIvnsbBwK1WLJlo AsHWJwAJZ56VRD0IqiWnNkGX2yJUBkqXBW0PIePcoh84wEW/0FITJeTwGSqLE8Nin7 g6r6X7PvTwgn+Uvv9fxopEvHlwa7nnz2UoD+AWKgyNfPBYpiCEGch4kiFqdz0dYM7/ wv/tOiLXlEoBQ== From: Davidlohr Bueso To: rafael@kernel.org Cc: daniel.lezcano@linaro.org, amitk@kernel.org, rui.zhang@intel.com, srinivas.pandruvada@linux.intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dave@stgolabs.net Subject: [PATCH 1/3] thermal: int340x: Fix bogus acpi_buffer pointer freeing Date: Thu, 24 Mar 2022 12:09:48 -0700 Message-Id: <20220324190950.70486-2-dave@stgolabs.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220324190950.70486-1-dave@stgolabs.net> References: <20220324190950.70486-1-dave@stgolabs.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It is the caller's responsibility to free only upon ACPI_SUCCESS. Signed-off-by: Davidlohr Bueso --- drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 4954800b9850..0e7931c286ec 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -186,11 +186,11 @@ static int int3400_thermal_run_osc(acpi_handle handle, char *uuid_str, int *enab ret = *((u32 *)(context.ret.pointer + 4)); if (ret != *enable) result = -EPERM; + + kfree(context.ret.pointer); } else result = -EPERM; - kfree(context.ret.pointer); - return result; } From patchwork Thu Mar 24 19:09:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davidlohr Bueso X-Patchwork-Id: 554180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2703C433EF for ; Thu, 24 Mar 2022 19:18:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244338AbiCXTUa (ORCPT ); Thu, 24 Mar 2022 15:20:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352899AbiCXTU3 (ORCPT ); Thu, 24 Mar 2022 15:20:29 -0400 Received: from bee.birch.relay.mailchannels.net (bee.birch.relay.mailchannels.net [23.83.209.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B60FA3D49D for ; Thu, 24 Mar 2022 12:18:56 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id DC8801218FC; Thu, 24 Mar 2022 19:10:14 +0000 (UTC) Received: from pdx1-sub0-mail-a219.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 58A72121C39; Thu, 24 Mar 2022 19:10:14 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1648149014; a=rsa-sha256; cv=none; b=0nzXfzfLI07AaejyBkztazlRPVQfvN98+FGboF1xM3Qu39nhUECQNmFA3C1KzirWvun5ry rxMITcKiBMQPu8om5iq1E1UKwqiayUNbr1z/ZDEytdGpXRLTVj6YRn55gy9a0rDu+Wv1DX TyiF1LIpHkufpsvFLDzjgfX4wuQXkHc33bJ+a+sfmLqbDPEdMB24JnUyUSbWGX5n4KUHP0 XWevHy9eFcAf7I9GtEe3Oyv+rDeDIhPq47Wmix+39CDsNvll3ggDj1EAhrJfXnhsa3eW+e ENF/amEd8TivAmB1yZxj8XAWdxKzRk1Qb0sNDXb+VPRdbqL34RN70cUDXrywIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1648149014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Ef/BhbfXwmRdWt8+0XEDOKb36uGcLnF/IyiMjiB8D58=; b=PIa71Tms2QdiN6UU1vZQDzf9pgWrOqsEqvdmRJJBjZyf18A26r3mkQ0dkmhfHmWrbSL4ia rq8yR9QK5jeXw0B9/wFdTOiAqbCDCVDpz8rKWy/ZzGziSPX+GaXFD0aCxRNH2ck6rWM4EW 6nR/F18wL67UShoS3vpjfCwrtZhzw+pHL4sAIYYjXNBAEz3H8S5mi9+aeuXvLumLKWL1Gs cYUFNHIqcHZxb45x3wqTCOQhunB9HmNG+cDmfJPASsDctkJS58eNplMFX1dgTV3xRZuU8l aVaXBO2poYetBN5jgwptu0PydiVK72LYYmJPRt8xaV3qpiBBpC9XH4XHEYbw0A== ARC-Authentication-Results: i=1; rspamd-7b6f4d8d7c-bzsvp; auth=pass smtp.auth=dreamhost smtp.mailfrom=dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from pdx1-sub0-mail-a219.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.121.210.153 (trex/6.5.3); Thu, 24 Mar 2022 19:10:14 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Snatch-Cold: 6c6a2a0908ddba89_1648149014717_3988453761 X-MC-Loop-Signature: 1648149014717:1742392537 X-MC-Ingress-Time: 1648149014717 Received: from localhost.localdomain (unknown [104.36.25.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a219.dreamhost.com (Postfix) with ESMTPSA id 4KPZYK04DMz2p; Thu, 24 Mar 2022 12:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1648149013; bh=Ef/BhbfXwmRdWt8+0XEDOKb36uGcLnF/IyiMjiB8D58=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=E9rGkPZUfIij56Cr/ZcU85FPINwwDZMLBs1RCp0VMUQ5SMPnPlyOekTd1/1IXR9wV d1fwUTZYohGRHv3o4gk9vx4kFwrCG9jobtw6ZSa5Lx1xWo9TwoCQL0MmCxpcva9S86 pcK4FuxEBg7ZlJCoK0Uj+ReS+GdwwiDbDtJLHQtoaqZpjrQi9no8JsdqN/5fYPxnOI TwUP68JS3wLJz+H0V82HIfah+HxIQfcA2GW9MfgVsG7xKlUxl2SxNgtFPWkvGKoUyf J0XIFLLQNZEBqz725+300Yk+r/lABWM9TPAZ6WchrIS7XWbUusnFLqXBVVfU/VXutS QjaXzhaBZeYpw== From: Davidlohr Bueso To: rafael@kernel.org Cc: daniel.lezcano@linaro.org, amitk@kernel.org, rui.zhang@intel.com, srinivas.pandruvada@linux.intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dave@stgolabs.net Subject: [PATCH 2/3] thermal: int340x: Consolidate freeing of acpi_buffer pointer Date: Thu, 24 Mar 2022 12:09:49 -0700 Message-Id: <20220324190950.70486-3-dave@stgolabs.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220324190950.70486-1-dave@stgolabs.net> References: <20220324190950.70486-1-dave@stgolabs.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Introduce a single point of freeing/exit after ensuring no error in int3400_setup_gddv(). Signed-off-by: Davidlohr Bueso --- .../thermal/intel/int340x_thermal/int3400_thermal.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 0e7931c286ec..e299873d50b8 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -508,21 +508,18 @@ static void int3400_setup_gddv(struct int3400_thermal_priv *priv) obj = buffer.pointer; if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count != 1 - || obj->package.elements[0].type != ACPI_TYPE_BUFFER) { - kfree(buffer.pointer); - return; - } + || obj->package.elements[0].type != ACPI_TYPE_BUFFER) + goto out_free; priv->data_vault = kmemdup(obj->package.elements[0].buffer.pointer, obj->package.elements[0].buffer.length, GFP_KERNEL); - if (!priv->data_vault) { - kfree(buffer.pointer); - return; - } + if (!priv->data_vault) + goto out_free; bin_attr_data_vault.private = priv->data_vault; bin_attr_data_vault.size = obj->package.elements[0].buffer.length; +out_free: kfree(buffer.pointer); } From patchwork Thu Mar 24 19:09:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davidlohr Bueso X-Patchwork-Id: 553974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBB35C433EF for ; Thu, 24 Mar 2022 19:10:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352866AbiCXTMB (ORCPT ); Thu, 24 Mar 2022 15:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352854AbiCXTLx (ORCPT ); Thu, 24 Mar 2022 15:11:53 -0400 Received: from bee.birch.relay.mailchannels.net (bee.birch.relay.mailchannels.net [23.83.209.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6611619C23; Thu, 24 Mar 2022 12:10:19 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1301422550; Thu, 24 Mar 2022 19:10:16 +0000 (UTC) Received: from pdx1-sub0-mail-a219.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 2948123242; Thu, 24 Mar 2022 19:10:15 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1648149015; a=rsa-sha256; cv=none; b=yhzzIByvXbznGmKutQ9ZAWSbwQMbuGWTilGUm64TrYF6Ccs1TO7Uf23IrIO+PI31KT3Ij/ P4fVeRl8bwJ/lG92xvGpZyW08tFH4xSGOCKpZNRSXTwBjuOsqVklHdH+EQaBhNbrHSI3FH Vqc45J5232wKLefZNw0NhtKhIHApzgKuHnr0ALOhkoWCNy4O8AtMR6Xw/5J3j4QC8zvHvN 83mHneCyoEAnkj750wmePZYHf67hrpHt2UfXhfK6LhsgYQgH/AW+yfdfTbYTYl7t3t2luk jLRUtoEY54U383A/y4Y1xIndfwdo3+I099bcD2sAvbNhAD2gfaaCjO5sJ4uszg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1648149015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BwxgQMQ/2QhljL9zC+DXVkORb2bFuqFJtoHA8uaXDPM=; b=2Rw/rqdT+5eD3nW9xk31HLxjzWegMrBru41oK4xAs8qA4Xmq61imuiBzwPuiJKQtPnIhrH U0RryXjt1HNjYEeBNNb7P8ClxtpGuXPOqZ3XQteSakEyCEh7n23F4eNOZXGcuRkjlERjQa Cq48xhOQN9kNnfXqXCofZeztmYe/rA1mky870mVS4FDJDQAHfPyTlpiQcfq35D7SXmwFLH xdH37j/e90V4a8xCx+/5a8hf8oOScoFn8ZmtWbltToOX7ceDG259WRlIC7Ill/oBzbc/GA nI1/BaJFgrOSMb8O/kZCP0/CsG5CPnm9eOETAgNX2hVwLDPPVrsvMDIBXdxJRA== ARC-Authentication-Results: i=1; rspamd-7b6f4d8d7c-xq88j; auth=pass smtp.auth=dreamhost smtp.mailfrom=dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from pdx1-sub0-mail-a219.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.124.238.100 (trex/6.5.3); Thu, 24 Mar 2022 19:10:16 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Daffy-Supply: 745c0e0402409ac9_1648149015893_1799478203 X-MC-Loop-Signature: 1648149015893:1003998337 X-MC-Ingress-Time: 1648149015893 Received: from localhost.localdomain (unknown [104.36.25.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a219.dreamhost.com (Postfix) with ESMTPSA id 4KPZYL12FPz3n; Thu, 24 Mar 2022 12:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1648149014; bh=BwxgQMQ/2QhljL9zC+DXVkORb2bFuqFJtoHA8uaXDPM=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=Et5Idvy8iG2kqDEXbmNVZSeV7oiOl/YMku3CwBRsx6njSKsGd6N/vI4unD7mCubWl /MgLrvT7pkNKM87Va6dqhSfssQ/37azCy+S29+UfttKc7/eB201ACm22f9TsD0MbmP PJQUkS383gQMLU7DsReBqQqBX11UMCfC1megklBP1WtHFIdKs2BsYzYYHzYuLF8K8n szosdjKT2o1xXznku/NhSLFqn8TDh7I2+lFkuJGQuRUcEkCM2DNfmLvB+lmsxtcehN Gm/CF9Z9ScxEz83o9p1MEkOkPgCq0+W6SZ6UAkA2RPS/4e+VTQbnKJ4JOG52o2j7BZ FarsdH0NJxpKg== From: Davidlohr Bueso To: rafael@kernel.org Cc: daniel.lezcano@linaro.org, amitk@kernel.org, rui.zhang@intel.com, srinivas.pandruvada@linux.intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dave@stgolabs.net Subject: [PATCH 3/3] thermal: int340x: Cleanup osc context init Date: Thu, 24 Mar 2022 12:09:50 -0700 Message-Id: <20220324190950.70486-4-dave@stgolabs.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220324190950.70486-1-dave@stgolabs.net> References: <20220324190950.70486-1-dave@stgolabs.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Now that the UUID is already sanitized by the caller, lets trivially cleanup some of the context arming. Signed-off-by: Davidlohr Bueso --- drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index e299873d50b8..4c49a6c9d4df 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -169,18 +169,15 @@ static int int3400_thermal_run_osc(acpi_handle handle, char *uuid_str, int *enab acpi_status status; int result = 0; struct acpi_osc_context context = { - .uuid_str = NULL, + .uuid_str = uuid_str, .rev = 1, .cap.length = 8, + .cap.pointer = buf, }; - context.uuid_str = uuid_str; - buf[OSC_QUERY_DWORD] = 0; buf[OSC_SUPPORT_DWORD] = *enable; - context.cap.pointer = buf; - status = acpi_run_osc(handle, &context); if (ACPI_SUCCESS(status)) { ret = *((u32 *)(context.ret.pointer + 4));