From patchwork Sat Apr 20 11:34:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 162594 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp484872jan; Sat, 20 Apr 2019 04:37:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxK5SdpssBLynYU207QIjr8AqEBwseC/0fWhR5F+fag6Zvz6ctoVBGJtxrj5XiSrBv3FY0+ X-Received: by 2002:a62:1a06:: with SMTP id a6mr9304555pfa.18.1555760224448; Sat, 20 Apr 2019 04:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555760224; cv=none; d=google.com; s=arc-20160816; b=Q4YLfFdl6y+cdvzIoPLadQnGvnXPqb7Wfj7aA9xl4iwDRxVHNKH5M4xQBxsAxZHNPB dZTyomeCJY26WI6S1RV893SebGLxgc53UP4cxtOGUSP1W9Teg0tiPwADfhoiVw1t5av2 ShUlXkNWKVVtqNoCj6rx6+Mad3YzGXeFpxJlMWQAE7xCgu6BuXpQTe+LGpVSSfQtNIfd DIw2zHkMUSOkooyg+gbI3NICLbzD61ux7kUezVzhXCd1Qgtu7O3RCSBpzaZRDKME4avZ IWE7NwaotDkA5G47MCpWotSbHiQMEfKW2IlGzaG7GRadeoP+edXgccT4rdz83WkuJmwd tRxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mNE0aOPV+S7Gbu4CUOfa+icowuG1l0JynCHHFRvDBQY=; b=ZpqL3gnfEnoZUDSefDvWVa7UHnwdPZXxH0fVZXcKumKUU0USm6XNjqR9hSVerI6MCw fKetf47NssRSLQq4q6NbPIZFU0niHcpYEVezFGWXeIKy1p8tXNnsXNy8cGcOBegAePRV EUvRR11vx7HmopzvMgJ6dJk56VsT3qDKSxw2h+RwvoIn+VH/nOoZ2ffInxKSTk6Q1AEB kcoQVqET9ztu4DCVgKj3KQ/mvhNf3+lXP5xT1lEpnJnR32mr97BlSLyMxlTA7t2aNP3G UOcff+46xux6iUO7vYpZGMzhCic9VBr94rggaYpGfaB3YS6ewMYSB3/rS4ZH+VoRsBr7 ETdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IMT/cp2v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id f16si7366128pgh.309.2019.04.20.04.37.04; Sat, 20 Apr 2019 04:37:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IMT/cp2v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1728184AbfDTLg7 (ORCPT + 30 others); Sat, 20 Apr 2019 07:36:59 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:36586 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbfDTLg7 (ORCPT ); Sat, 20 Apr 2019 07:36:59 -0400 Received: by mail-lj1-f194.google.com with SMTP id r24so6601605ljg.3 for ; Sat, 20 Apr 2019 04:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mNE0aOPV+S7Gbu4CUOfa+icowuG1l0JynCHHFRvDBQY=; b=IMT/cp2vcR9SLiRqsEv0hJQvIkvGUFDDGmYwZeBvQ/xuqpIHVhu7aavX22SpAdlUEu Qu8gWp5e91+F1AY9EMs7ppg9Hg8NwEWHKNtrLXgsQN54gpz9fPnA0he1Ve2Za56v4n9o E6TO2T9KA70Zqx+oTVdNzVCTWrOexIj1CXG3PZFQeuGiRXBGVc8kIMiR1f4xVroDV35/ flFOwnkW84zgBmAPFGNxiy4LO6G2RN20cRjb3ube8CCgw/Mbw7a58Dz/cfsGNVVI6aPm OZRagZR6dYItgsPAr/N3VJOBViAVvEumsj2Ay8XMBUM4CRHPVnHwFHjtxFYV0AnHRYuF sbzw== 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:mime-version :content-transfer-encoding; bh=mNE0aOPV+S7Gbu4CUOfa+icowuG1l0JynCHHFRvDBQY=; b=RHA8mmLisSGSc+SPwMPY73IprgIVRdq9OOMzfxgJXKFyTNagfCkMqjaAOueJDDEtvz NI+/3K0u7XZGmVa6bGaCdHD8I0A7UYsfQs0f3o40dmu859PY0Y2gRW+EqQuPEZY2vV1H 5ioaJ5PJGV9SyxC+C+qi92aDm/mFrS79g9QX8j40IY2WC2id9QfLmLH22D9DevDUmZ3c TX+iXRe/5lsVHim3dk5HiaBUmHZBGO5VyxxKhKRe0pviFVBAq6N2rLrXGpRwO/7DkjsU HLbs2cPE+ZkJJoVogI11nrtfWyDiktGM89kPHb1c9Hx13/B2FKBjtopqZvqACtqUIRCK yDEQ== X-Gm-Message-State: APjAAAX8IrRrKJ84A6J4+Axwu360r4qDZ3JXlzulJXwxYRO7osLcGPvd ajIHETiZQYObZ2ipg+eSfc743GzBVQQ= X-Received: by 2002:a2e:b01a:: with SMTP id y26mr4849606ljk.38.1555760217262; Sat, 20 Apr 2019 04:36:57 -0700 (PDT) Received: from localhost.localdomain (c-c5d3225c.014-348-6c756e10.bbcust.telenor.se. [92.34.211.197]) by smtp.gmail.com with ESMTPSA id e18sm1633994ljb.12.2019.04.20.04.36.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 Apr 2019 04:36:55 -0700 (PDT) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Charles Keepax , Bartosz Golaszewski , Marek Szyprowski , Linus Walleij Subject: [PATCH] regulator: core: Actually put the gpiod after use Date: Sat, 20 Apr 2019 13:34:30 +0200 Message-Id: <20190420113430.9856-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I went to great lengths to hand over the management of the GPIO descriptors to the regulator core, and some stray rebased oneliner in the old patch must have been assuming the devices were still doing devres management of it. We handed the management over to the regulator core, so of course the regulator core shall issue gpiod_put() when done. Sorry for the descriptor leak. Fixes: 541d052d7215 ("regulator: core: Only support passing enable GPIO descriptors") Signed-off-by: Linus Walleij --- drivers/regulator/core.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 68473d0cc57e..362f34e73a3f 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2256,6 +2256,7 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev) if (pin->gpiod == rdev->ena_pin->gpiod) { if (pin->request_count <= 1) { pin->request_count = 0; + gpiod_put(pin->gpiod); list_del(&pin->list); kfree(pin); rdev->ena_pin = NULL;