Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp172513lqo; Tue, 7 May 2024 16:35:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9P7GS9V/8aD606rxvcMioGauams39O4XJthRYHJhaTQa98gwveoJjp0A15BFy0ske2M84b25wnlDb7FF28CQv0FLBmKgL/EPAOzkxaA== X-Google-Smtp-Source: AGHT+IEJ6AOxrK1URqjhnmNCs43/yG/QHKyo+sHI0MZag7jTLWFwiDUZRR2a1csxSMUU7i566x36 X-Received: by 2002:a25:6892:0:b0:dc6:ff6b:71b2 with SMTP id 3f1490d57ef6-debb9d701d7mr1151043276.4.1715124933999; Tue, 07 May 2024 16:35:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715124933; cv=pass; d=google.com; s=arc-20160816; b=aMW1jwjLp2KQQgYvfMd70BCSqZ88ZMCsnyMAtb3izjvRp1Y0c+ReZCuPsiGxw4ft8C 8VvycfiDwLPpbi76ue7V7+HgP8S6hGU2sDUeciivAU+XtRXLbOrRFe2ZmMD16q4X/03h Edf7ID73MbV+BQOly3DzuhSe+PEOJIrFnxO6WssOr3AZnIO3DmRZXfY6p0vfVIDQnlH5 xi3NZHoxi4kOJx3JeZV9Z6kj4+Vn1+P5pnwfsyfwPgXO5iUsO11fRqq+l5GLFiWQWRSI otnZO6XzeRCeM8mTNYyZg3PNcH5C9pnkju5MalpNlqKo9c3g6AU+zO2VZN21TMHmfdT/ /L4Q== 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=esvLM1Ev9TkD77WJPawyVi/qjho7xVPairzp5Lp+1P8=; fh=/T/mBsdbkhUvUwBIk3e9WSRkrFjC7QcGVwrF8VNJY1E=; b=ao5sK76HOyZeI1ayqoQVgBNhXVOx+RDcilO21+CYcXXLrmrfTziXLCxJEUo8BbqVRH d3gZRxupfp6XICYycCzXmjcETnn+EML0z20oO1tMHDD93fGUtrcHgEy9AVat32O0WK3H SRkK4Y+oq/BuS0rgQn+26DQtFOf4x1fUTvWIHGLjTrEPgfSmnBa29u0gTg0CE9QBbq+B fiVGbci+kAsl1nwzx0Y7UcCtndHqOQGHtjKI1PMVUvzbf1Xxj0V/1EwI300rijWMwb2T xHifS4hjZ0K1sJscNcuR7VYklJt+AGNYqV1DUs/VYUoXrcTIBPyuKIj2Qh8FoPOXgY7z 4/Ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kEVKT9wo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n6-20020a05622a040600b00437c0121802si13062669qtx.446.2024.05.07.16.35.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:35:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kEVKT9wo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B32961C21D86 for ; Tue, 7 May 2024 23:35:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EF4985C43; Tue, 7 May 2024 23:10:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kEVKT9wo" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A430E86242; Tue, 7 May 2024 23:10:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123437; cv=none; b=UsElZzRtIAWWxXxcktHIGTQus/grcgNZJr6emS8mwjevjWecAAR/vdrnh78LZL8x6DEMBNnnrHUDbFaAVP5aEj2b/BfpG822uhnJ2D7QoDSwt2jc5mdfLq9FPMKY0lswGco/SoxDVOHHL9i/xn12sBPDt6O7loJHyqeJB/s+FuQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123437; c=relaxed/simple; bh=5035YfqJvmdZ7+1bWo3KgAUQmy86nDyJRs/SDTLghno=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GVjZoyj+W1UbXzpP9j+dsx4O9t9QromLFGZJ5ZxvgzRt7VDEcC648nv2uXZ7lmxjkbrapogc4gbV8lvOGJ+mDYHw49TSlqB+TJZClPyLwXfjSkzziznO3Fy9sp58PXw84/L1wNBqn44cjYr8wsprLXEoqDpIRKHhov8aGHRfuP8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kEVKT9wo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0BF7C2BBFC; Tue, 7 May 2024 23:10:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123437; bh=5035YfqJvmdZ7+1bWo3KgAUQmy86nDyJRs/SDTLghno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kEVKT9wor0upiM3ixseS/8XLj54HCNXafdGW6DpTU0LATfonN0+XOqpD56mjDU2Mi g1LEnwCU3dGzyOjVOAPr2+QZVFk+BMNMb5oQfNHKvAbeqmo8yVE2ZMBQTmI95srYVN IqHRvAUBOzLgNw32bETN09Fa8J5uw+QiQ83P+F14meGnPPzGHf3DUqdJdww4TbsOk9 jiLqvktg6n28WqmLXxzWcJAfuOjQPVnK39+6BdN5LrGdqpaFQ7QB3KkPRFgi/Uo/u9 6/ctcp5TXacS8CkEvl9LDJVqgF3V92vjs4fFBfUwqCldmRk5U7IAIseswrqqT0Ph0g Q0kogtulXmqkg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Matti Vaittinen , Mark Brown , Sasha Levin , lgirdwood@gmail.com Subject: [PATCH AUTOSEL 6.6 02/43] regulator: irq_helpers: duplicate IRQ name Date: Tue, 7 May 2024 19:09:23 -0400 Message-ID: <20240507231033.393285-2-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507231033.393285-1-sashal@kernel.org> References: <20240507231033.393285-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.30 Content-Transfer-Encoding: 8bit From: Matti Vaittinen [ Upstream commit 7ab681ddedd4b6dd2b047c74af95221c5f827e1d ] The regulator IRQ helper requires caller to provide pointer to IRQ name which is kept in memory by caller. All other data passed to the helper in the regulator_irq_desc structure is copied. This can cause some confusion and unnecessary complexity. Make the regulator_irq_helper() to copy also the provided IRQ name information so caller can discard the name after the call to regulator_irq_helper() completes. Signed-off-by: Matti Vaittinen Link: https://msgid.link/r/ZhJMuUYwaZbBXFGP@drtxq0yyyyyyyyyyyyydy-3.rev.dnainternet.fi Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/irq_helpers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/regulator/irq_helpers.c b/drivers/regulator/irq_helpers.c index fe7ae0f3f46af..5ab1a0befe12f 100644 --- a/drivers/regulator/irq_helpers.c +++ b/drivers/regulator/irq_helpers.c @@ -352,6 +352,9 @@ void *regulator_irq_helper(struct device *dev, h->irq = irq; h->desc = *d; + h->desc.name = devm_kstrdup(dev, d->name, GFP_KERNEL); + if (!h->desc.name) + return ERR_PTR(-ENOMEM); ret = init_rdev_state(dev, h, rdev, common_errs, per_rdev_errs, rdev_amount); -- 2.43.0