From: Raag Jadav <raag.jadav@intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org, bleung@chromium.org,
groeck@chromium.org, andriy.shevchenko@linux.intel.com
Cc: linux-kernel@vger.kernel.org, Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v2 1/2] regulator: devres: use devm_kmemdup_array()
Date: Fri, 28 Feb 2025 12:50:56 +0530 [thread overview]
Message-ID: <20250228072057.151436-2-raag.jadav@intel.com> (raw)
In-Reply-To: <20250228072057.151436-1-raag.jadav@intel.com>
Convert to use devm_kmemdup_array() which is more robust.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
drivers/regulator/devres.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c
index 36164aec30e8..ab238579879c 100644
--- a/drivers/regulator/devres.c
+++ b/drivers/regulator/devres.c
@@ -332,9 +332,8 @@ int devm_regulator_bulk_get_const(struct device *dev, int num_consumers,
const struct regulator_bulk_data *in_consumers,
struct regulator_bulk_data **out_consumers)
{
- *out_consumers = devm_kmemdup(dev, in_consumers,
- num_consumers * sizeof(*in_consumers),
- GFP_KERNEL);
+ *out_consumers = devm_kmemdup_array(dev, in_consumers, num_consumers,
+ sizeof(*in_consumers), GFP_KERNEL);
if (*out_consumers == NULL)
return -ENOMEM;
--
2.34.1
next prev parent reply other threads:[~2025-02-28 7:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 7:20 [PATCH v2 0/2] Convert regulator drivers to " Raag Jadav
2025-02-28 7:20 ` Raag Jadav [this message]
2025-02-28 7:20 ` [PATCH v2 2/2] regulator: cros-ec: " Raag Jadav
2025-02-28 21:22 ` [PATCH v2 0/2] Convert regulator drivers to " Mark Brown
2025-03-06 2:15 ` Raag Jadav
2025-03-06 9:19 ` Andy Shevchenko
2025-03-06 10:14 ` Raag Jadav
2025-03-06 11:04 ` Andy Shevchenko
2025-03-06 11:32 ` Raag Jadav
2025-03-06 12:37 ` Andy Shevchenko
2025-03-06 12:50 ` Andy Shevchenko
2025-03-06 13:22 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250228072057.151436-2-raag.jadav@intel.com \
--to=raag.jadav@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bleung@chromium.org \
--cc=broonie@kernel.org \
--cc=groeck@chromium.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®