[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240821031807.3781853-1-yujiaoliang@vivo.com>
Date: Wed, 21 Aug 2024 11:18:07 +0800
From: Yu Jiaoliang <yujiaoliang@...o.com>
To: Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: [PATCH v2] intel_th: Switch to use kmemdup_array()
Let the kememdup_array() take care about multiplication and possible
overflows.
v2:
- Leave one blank line between the commit log and the tag section
- Change subject to intel_th
Signed-off-by: Yu Jiaoliang <yujiaoliang@...o.com>
---
drivers/hwtracing/intel_th/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index d72993355473..df72037c1c86 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -408,7 +408,7 @@ static int intel_th_device_add_resources(struct intel_th_device *thdev,
{
struct resource *r;
- r = kmemdup(res, sizeof(*res) * nres, GFP_KERNEL);
+ r = kmemdup_array(res, nres, sizeof(*res), GFP_KERNEL);
if (!r)
return -ENOMEM;
--
2.34.1
Powered by blists - more mailing lists