Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp172268lqo; Tue, 7 May 2024 16:34:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGxo+uxFsWJ1EqZO6vhaFNappY1wsNbrNpKjWuXxr8a8ATUbLnjoeg0o73/MEyvftwZITg/JmApOA+YRkn8I2Da6nkHxmsc1PjLMLULg== X-Google-Smtp-Source: AGHT+IESiKcer5bljCE1UDsytRRagjHq9SWrRSEVxvd3qXRUZdvvM47Z/u1KYU8WF9cYNM3bdlPn X-Received: by 2002:a05:6358:57a7:b0:192:6e88:b14f with SMTP id e5c5f4694b2df-192d2d215a4mr126693255d.9.1715124895757; Tue, 07 May 2024 16:34:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715124895; cv=pass; d=google.com; s=arc-20160816; b=GN3Nr6QR9AN1p4Rnd7AJBAYkQ9iJoU3+yMSbDCPhIBdDFMNiILQjVvsCImW92i3zdr LqnOaqkAdYHsx6HJjhz85IPmPCgB4BCVmTnylbnxmUeflFRvBESiEgJxCYF96cDmBFxr f9CnRbn2/13eHJkdjSuCVspoURXN7W56TuPryk7I7gzp0Q2Zdee7CRz43XgoFIgY5Gqw WIEYIvK7KsrEyOMTn2ez0LGAN9SjF6BqrNK3u2a2MLDxE9Ks4wVKpfvlcaQm3oZYHD5Q 9HBXm8d/WX0dyHIHZn88nkBc0pPB+7brIRvGAi8yxruy/WpvA6Wb/DOGOqxDpGkxSjJd 6tRA== 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=Ca1eV+/kXjqSzW8h1Rfe4uPNdIe6nlT8CaqA6bv1jjDKG/kJ0iXriswVndbqN+e95m zeOhjKJ+mjVFQYDWsF5eFkxb/HZVH+ZXUQQ+x+SgkQzJ8osGPH4jKYp5w2LWU5kTyFNZ INMlV1P9RMehpBJSecQos0OG3td8KjPg+VuWkdKITzfuHvxtP/AnoieHW0a3ygoHzkdZ NskXeoDct/IWBiA1C7U9DJHMYS72Zm8UpUMzMalPP6Ya4wpLbZWlhWj52gbkhfVIQtOk oI92qAh+CY8/t3TmoUovfGsuvuUvkP9Yo7XMImRbhUUkw0oSGiUk5qHA4+OXk6E/qr+g ybrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dOvChpfR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172344-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172344-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n13-20020a63ee4d000000b005f807292982si11312818pgk.888.2024.05.07.16.34.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:34:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172344-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dOvChpfR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172344-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172344-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 693A7B227EE for ; Tue, 7 May 2024 23:22:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B8B784FDA; Tue, 7 May 2024 23:08:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dOvChpfR" 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 512787F492; Tue, 7 May 2024 23:08:04 +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=1715123285; cv=none; b=FQrpEcbGR2rFsIFmmmq7cgOzgGYZnGSMzz8huT0kXWpPOcMUR88JUf5+iGY95YY3GVQVUqqIP1yqJf+pNGd8jr63NYf9gR7mzRpIT0uI5h4Skot8K0x5K926TkuS7EM6wOlTIMTkXPCYexQOJGezW5RmD8N+P+7eu6R7RXJK8Z8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123285; c=relaxed/simple; bh=5035YfqJvmdZ7+1bWo3KgAUQmy86nDyJRs/SDTLghno=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uu4Bnk6eJM4yUX48Rh1QpXTrU2Kjzjgc1+acJ+Yn4jtfMuijYh22zU6nTq93M5rhKhN+z3ly7l9W0F0CNqSXWEJ0Fjl6JH7yPl7AEm1k+l+0TYmPAaoIKyvhKUI9G6jby3ffvo6jQfUpMJVPtB5+TYqDA/A36v+k4T8VGyVPyYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dOvChpfR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1ABEAC4AF67; Tue, 7 May 2024 23:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123284; bh=5035YfqJvmdZ7+1bWo3KgAUQmy86nDyJRs/SDTLghno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dOvChpfRcBuxliPkkZhg3dVDQOi80zqXLiXdljl8o4clqVcyu8qk6fkoTJgVDXo7j 3TLfUqoNr67pRWV4V/mrbiw9koDsD9toxk98TjDOanV+Eba8VSyctbML6184vonb7S zXmFwDDzjIjlxFf0Evposfpr6EUDWYkSDR7TZ9wOOaSRkOY/ZhpfNWkKNT7dbfDAFk tMTpwNcjPpdZEwuBtrKnFSKqEMSp7/1T4WCyvSd4y3YVEVlaTy0gYm//otlmwJhU/6 3uNTWMcMeDGA77fgafBbt485eczVl0GvA5IgudkVWQkyHoBqKTvK7vaKYj1U/pLMjE ubpA+LdnFwqUw== 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.8 02/52] regulator: irq_helpers: duplicate IRQ name Date: Tue, 7 May 2024 19:06:28 -0400 Message-ID: <20240507230800.392128-2-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507230800.392128-1-sashal@kernel.org> References: <20240507230800.392128-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.8.9 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