Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1678000rdb; Tue, 20 Feb 2024 03:57:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV5S4ZeuQgIA1tyQsmUa86A+O+aBHrFO4PUQtOsx1aIMZqb7v4k9hnCLX+4WZwCONqlp8GnbcZOzPn9/fZMBBp6imx8sSV1z1KWD0WyGQ== X-Google-Smtp-Source: AGHT+IGSEJ/A9Udg8w0WggH/Y80kJGN06F7pWQWQqskZwDdqqpToocqHQuKfYeLs/KOqJJtIJzoB X-Received: by 2002:a17:906:ac5:b0:a3e:ab9f:4129 with SMTP id z5-20020a1709060ac500b00a3eab9f4129mr3112045ejf.75.1708430240561; Tue, 20 Feb 2024 03:57:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708430240; cv=pass; d=google.com; s=arc-20160816; b=yUUnOAO78RPBAG2JadzrKoAMEoCh1BuwvUtk1A7fjRWSyJnPHNwKyuhG27t46FX59q CSXDc6xwYytbyDdA2qz3j1ClgApNFmTVWEIn5MPtOHhzX4JTS6VDgDL80HtlMoEoLbzY 3eZVUOOretLXXYCzRszxQKvEtoZUYvqen0GToBaEFr5SjykiUFPyPR3s3ulQBec6N7E9 9I6qFIS1zNVtUmIqEldS51LGW9SNIV0+x8odKXVfzu7A0QjqoEI14/KsU9KmSocxRNc1 4+TSFn3anCi5DcG34kXf/ymNGWtQCPMelRcq5jB+cXveXcn3eIA/RDSY0qRV33bcxOWs MLsQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NC5xe2uxCxCjh2/t9Ad3AWpCcmsygcw6ycwZ3qcHHbA=; fh=oM9VGGCV6Vfk9qdAAGxloqx5c49e7XKZHeB0EBHVoYo=; b=KG+CZu4LIODAfPgUrOvhYosxi9nBnq08os185U671SKQQqxBjigKHLoZ3b31aJI7Ot RM2lbmjkpiCKZFFEXIgFoDhCjJlkWnHrU+KvHy6UuJV0DAa7PxlsIoXG1c+IRlU7Oygg i9gj4fzuzYSUmeWA6GSCfLOryy0s2ltZtwif7DLSjh2XBksBvGZpNqgmZbiL5dAfr72i oqt9HTOVoz/09irpLxj2s3hup76i2r0qllsLZkzOBU6LuN3s2yBgEVtebVy3LVnKCOY2 fC8aSDVYefUONGdYejjGaqiq7feL1x7Kx1m2K1dj7kim/15iVhfkMGRzg4/fx9U0p25o dwjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ulcMRjcU; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-72941-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72941-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a6-20020a1709065f8600b00a3df9e0fb14si3459072eju.648.2024.02.20.03.57.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 03:57:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72941-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ulcMRjcU; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-72941-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72941-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5F8801F267BD for ; Tue, 20 Feb 2024 11:50:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FCDD67C58; Tue, 20 Feb 2024 11:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ulcMRjcU" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A3636773B for ; Tue, 20 Feb 2024 11:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708429820; cv=none; b=bmeRG6Gffdegf4bVrcAzbdnR5mXIXTxdrNnPoNgikw94sGQdTIPszRnuS5p48jDWXa+RpgeGKxFSS3Rybupi+twQB9kmZiI0/Ug9j6ClFpRYX7/76lj3KbYHN329+8RkRqGWrO9Ek2GwMDzkaksvIPhDrMAfeiqiBqE5IvbC1qM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708429820; c=relaxed/simple; bh=cYDoCiKTRi+gPhjiLH2ZPtZdUHcsgOWojEx7bGvUiok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BYarOOU778uH9rkqqw9lS9SscdWT92AV/iSx8b3AV5Dzh46DHtqxzfjVFNO08+x4bOKAN76RDtmFjOZunWv05VvyWgJ8anDGU77XyxNchZWtvpjo5/b75lBthz5w2RbsZ+3Igb98b+8qO5ym+3mBB6q8knICcRm32xwMWEIJX+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ulcMRjcU; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-564d332bd73so535209a12.3 for ; Tue, 20 Feb 2024 03:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708429817; x=1709034617; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NC5xe2uxCxCjh2/t9Ad3AWpCcmsygcw6ycwZ3qcHHbA=; b=ulcMRjcU61jrEuhPPhEdH5Y0kmkSXroKFHsYxtK4GgDJoEpgogWcItl7YpUPUYsfdf 9nIaMzubXM3NQUXHtZ0q5X/RFbskJt/tBZEPhUpUFL8MxOS+1p4OWs8dVc1o3oDlpyRC IpoJalaQtFJVzr82MFKqnDL+JIlEKiECPn+RyFPKm816zQM/OpQbgKmlRDS/5hSViytN 71ZztEqcYzE9ZQ4MTSQN/zMXu+3717qBigiFfn8nEzhr6lrptxbBZxaIqfoBQe/CT1c4 IMWBZqHjoHL4e3v8bZxBRPCN1ELFKF6oR3r6Okp1BHnD7jNT7bxXaIo5tAH1ZBYC4jGb gF2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708429817; x=1709034617; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NC5xe2uxCxCjh2/t9Ad3AWpCcmsygcw6ycwZ3qcHHbA=; b=JmNiTTfOqYfDUIDWQN9pgoNE5o827tY+3l7zG6325XDTeX+QwprrQNsVm+dfTen/Zr 5jmB2p9r7+Fn8BZxU/qdPDxFnbYCEGVUKT5P0BpVTErGKXToyZc2z6GJDtAsAh2Dl+AS wlG6ndGZOgkaqUzhGpj1Pq6f7jz2SMSQOHl34umVLOqE07JcIEzW/L5qsPpU2ou2j0On nH8n2kDUMygEO6F5hMqZ6NExm1s/hKUOPJFq4FbuyCCE45E6lAGxJ9Ocd787G4Y+ck9Y 6KjJt1e9NDetL2PMTNDSbUzCDGVmck6aTXeNgHJwMBY8wMTx00JEtpYSW473KMyul6O8 GDaA== X-Forwarded-Encrypted: i=1; AJvYcCXg62TBBNi7zlfremoY+75YLHf1gOff8fbWuu7HrbgVDSRHHvyecprJXaktYsrpjyz+r2bvsmnYgyz8fgM3MoGm9R32/Ivy40JMzLET X-Gm-Message-State: AOJu0YyD8gx/yxU9IcFEQlASPyOTKC1H1/cOZAh1PO9tgUC4LQt7NikQ d5xCrN4T1j8BxLxTneuP35G7nLvBCuaaHZkOwsJzqUDHxLHY4fxCSGZMCmD7sTw= X-Received: by 2002:a05:6402:693:b0:564:56e0:5643 with SMTP id f19-20020a056402069300b0056456e05643mr3817369edy.27.1708429817344; Tue, 20 Feb 2024 03:50:17 -0800 (PST) Received: from gpeter-l.lan (host-92-18-74-232.as13285.net. [92.18.74.232]) by smtp.gmail.com with ESMTPSA id u16-20020aa7db90000000b005645c4af6c7sm2317832edt.13.2024.02.20.03.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 03:50:16 -0800 (PST) From: Peter Griffin To: arnd@arndb.de, lee@kernel.org, thor.thayer@linux.intel.com Cc: kernel-team@android.com, krzysztof.kozlowski@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, pankaj.dubey@samsung.com, tudor.ambarus@linaro.org, andre.draszik@linaro.org, saravanak@google.com, willmcvicker@google.com, Peter Griffin Subject: [PATCH 1/3] mfd: syscon: call of_node_put() only when of_parse_phandle() takes a ref Date: Tue, 20 Feb 2024 11:50:10 +0000 Message-ID: <20240220115012.471689-2-peter.griffin@linaro.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240220115012.471689-1-peter.griffin@linaro.org> References: <20240220115012.471689-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit of_parse_phandle() returns a device_node with refcount incremented, which the callee needs to call of_node_put() on when done. We should only call of_node_put() when the property argument is provided though as otherwise nothing has taken a reference on the node. Fixes: 45330bb43421 ("mfd: syscon: Allow property as NULL in syscon_regmap_lookup_by_phandle") Signed-off-by: Peter Griffin --- drivers/mfd/syscon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index c9550368d9ea..7d0e91164cba 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -238,7 +238,9 @@ struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np, return ERR_PTR(-ENODEV); regmap = syscon_node_to_regmap(syscon_np); - of_node_put(syscon_np); + + if (property) + of_node_put(syscon_np); return regmap; } -- 2.44.0.rc0.258.g7320e95886-goog