From patchwork Wed Feb 24 18:30:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 386873 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp593389jap; Wed, 24 Feb 2021 10:31:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrEc3u+QK9UFinUTSGFDInWZK2xfsRWwZSbLuhfU6R+5nljkbyWzzSxZtAeqtr6x+Dlz4T X-Received: by 2002:aa7:de8f:: with SMTP id j15mr35176350edv.268.1614191476063; Wed, 24 Feb 2021 10:31:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614191476; cv=none; d=google.com; s=arc-20160816; b=Inv9OiiNnbdBTeUxLor8HkgWxkUM5e6vFcgMdHLKKWS9GMcZERkp3MM5VmDumRoNXC XiHVvGIvixSCHC0h97tCgD7632nOuHRHRJ5Aq9A0JPk1T9wuNysOxsCpS/9EK6OdCNBu Pn6329bCG0DkKu/Zw18Mbvw02aQvGGCt6y+hjf6l5bJMy6iRj1pc+SRq09D9nOciUl3G 5CgR0sM0JIAdKzWtr5Nxlj7N36msp63HsUoT6Z0b8St4YEwTWusDMAvxl/Z+YgHzDJSQ mlP29KhQRrZMZReak1XQRGt8VIAyd+bPB7lUT7H8qT9otqYOLCWMJ715c39mcvXuBefd 5mRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=HNg21NrFFSzG03akl4ik4jz1Jh6GwsesirJ9uxFbwiU=; b=kdz6Vt69eYm3/C5AGgWbbJks3Fuvdbtt5gYUNrHqXlJ2VxWqvGAaMDDAgRyHz05ZBi ln7GBIzyP74EWlwUTYxpW+rGoryR4z7/llcHykz0MTPsruz1w4mTqdJJ9jjleLk7JTdv g7hATiW429+8JYlMOAzfcj5yv20dsiSk8uqlpJNp3MSvv0MM1H1zs43qTtbYvo+kNiot z7+scCnWC0w1t9XK6P+iYmOQPMZxr0qSiPZMB3GEVta4HVMdNoK8CruaUnqrnNCR3ZpD yU2flb/2o1SsAjRJfGZltg4Y5Rke4Jz7X0oYqfYcBIOO2ezbb+nHfOFpYiJt9jHRJlTV wulg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mu++/MQT"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h17si1816305eja.457.2021.02.24.10.31.15; Wed, 24 Feb 2021 10:31:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mu++/MQT"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231895AbhBXSbO (ORCPT + 7 others); Wed, 24 Feb 2021 13:31:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbhBXSbN (ORCPT ); Wed, 24 Feb 2021 13:31:13 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73B1CC06174A for ; Wed, 24 Feb 2021 10:30:33 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id e10so2618853wro.12 for ; Wed, 24 Feb 2021 10:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=HNg21NrFFSzG03akl4ik4jz1Jh6GwsesirJ9uxFbwiU=; b=mu++/MQTLxhrxBnIq7qWduUGmbOCTgcpg/K1MUKyzsPEvgWoczFajqUT2PUn1tyqty 88/iOpznl4DdlFoWt5bbEW8G+TWi2W2NaODfzFYFIqW7wlB0o7S7FkdXU7RmYJziWvWE uw7ZQspVgYGALyjNfRDxE8mA0MlnlQhKUBiWjdJ/FtGugpdAsUCdeuv7ljurlnMUDO1q XlAqJTQn42+dFtqhRvpwy98i2REuaJKoi0J64R4ekhZVivfZ83dVbg6n5WMzxX1aaQG6 cV1EaqPusecLBLtdTmM++T2xseC5nGB9Qww8/N/9PCQOZY0Y0gfzzncNSImga6iY6Hvs zGvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HNg21NrFFSzG03akl4ik4jz1Jh6GwsesirJ9uxFbwiU=; b=B8+Py/0HHZBnHU+8DDLQ4zluLGUieHj8Ic0FCYls4Jf8VdCPUdntZ9BEOzdqsc8Vw2 G7KsI6jww0hOF6As8jfMjFE2k6f4WTsfC+ef+1foOZkjtBFyTB5lcTqX5l+lI3E19akb gFDhwc4gMGd4el/M5fb3PnnRphYxoeq9diHDlaLxPgTD848qcU39lhafA4/+PRgQ1YBW 3G99eBvgUjtNL7Ra2n9RlOWnnJtsIKez6MRlhs5cUcjAKMzEdZZFqzPdX5xyfmcc8/Ud islTp7FGlqfjeBXx9RtO/JY32AF6o33E8K+DKHPQ88CQMtGCruoeGcDrr3A12rWzAAtw 7CLg== X-Gm-Message-State: AOAM5330oyxs7FqMCsl3zzhf7I6NowZbt1NUp3S8CbW6MXKzfRiRxE6u HLP+VqhAqSgL6gXm+Ycs0NL4QQ== X-Received: by 2002:adf:8151:: with SMTP id 75mr3926866wrm.152.1614191431901; Wed, 24 Feb 2021 10:30:31 -0800 (PST) Received: from localhost.localdomain (lns-bzn-59-82-252-157-252.adsl.proxad.net. [82.252.157.252]) by smtp.gmail.com with ESMTPSA id c12sm5105987wru.71.2021.02.24.10.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 10:30:31 -0800 (PST) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@linaro.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization Date: Wed, 24 Feb 2021 19:30:21 +0100 Message-Id: <20210224183022.11846-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The root node is not set to NULL when the dtpm root node is removed. Consequently, it is not possible to create a new root as it is already set. Set the root node to NULL when the last node is removed. Signed-off-by: Daniel Lezcano --- drivers/powercap/dtpm.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c index 5a51cd34a7e8..c2185ec5f887 100644 --- a/drivers/powercap/dtpm.c +++ b/drivers/powercap/dtpm.c @@ -207,6 +207,9 @@ int dtpm_release_zone(struct powercap_zone *pcz) if (dtpm->ops) dtpm->ops->release(dtpm); + if (root == dtpm) + root = NULL; + kfree(dtpm); return 0;