From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>
Subject: Re: [PATCH v1 1/1] coresight: core: Switch to krealloc_array()
Date: Fri, 21 May 2021 10:10:44 -0600 [thread overview]
Message-ID: <20210521161044.GA997016@xps15> (raw)
In-Reply-To: <20210520135041.56163-1-andriy.shevchenko@linux.intel.com>
On Thu, May 20, 2021 at 04:50:41PM +0300, Andy Shevchenko wrote:
> Let the krealloc_array() check for multiplication overflow.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/hwtracing/coresight/coresight-core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
> index 6c68d34d956e..a7971c68b0be 100644
> --- a/drivers/hwtracing/coresight/coresight-core.c
> +++ b/drivers/hwtracing/coresight/coresight-core.c
> @@ -1730,9 +1730,9 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict,
> if (idx < 0) {
> /* Make space for the new entry */
> idx = dict->nr_idx;
> - list = krealloc(dict->fwnode_list,
> - (idx + 1) * sizeof(*dict->fwnode_list),
> - GFP_KERNEL);
> + list = krealloc_array(dict->fwnode_list,
> + idx + 1, sizeof(*dict->fwnode_list),
> + GFP_KERNEL);
Applied - thanks.
Mathieu
> if (ZERO_OR_NULL_PTR(list)) {
> idx = -ENOMEM;
> goto done;
> --
> 2.30.2
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>
Subject: Re: [PATCH v1 1/1] coresight: core: Switch to krealloc_array()
Date: Fri, 21 May 2021 10:10:44 -0600 [thread overview]
Message-ID: <20210521161044.GA997016@xps15> (raw)
In-Reply-To: <20210520135041.56163-1-andriy.shevchenko@linux.intel.com>
On Thu, May 20, 2021 at 04:50:41PM +0300, Andy Shevchenko wrote:
> Let the krealloc_array() check for multiplication overflow.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/hwtracing/coresight/coresight-core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
> index 6c68d34d956e..a7971c68b0be 100644
> --- a/drivers/hwtracing/coresight/coresight-core.c
> +++ b/drivers/hwtracing/coresight/coresight-core.c
> @@ -1730,9 +1730,9 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict,
> if (idx < 0) {
> /* Make space for the new entry */
> idx = dict->nr_idx;
> - list = krealloc(dict->fwnode_list,
> - (idx + 1) * sizeof(*dict->fwnode_list),
> - GFP_KERNEL);
> + list = krealloc_array(dict->fwnode_list,
> + idx + 1, sizeof(*dict->fwnode_list),
> + GFP_KERNEL);
Applied - thanks.
Mathieu
> if (ZERO_OR_NULL_PTR(list)) {
> idx = -ENOMEM;
> goto done;
> --
> 2.30.2
>
next prev parent reply other threads:[~2021-05-21 16:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-20 13:50 [PATCH v1 1/1] coresight: core: Switch to krealloc_array() Andy Shevchenko
2021-05-20 13:50 ` Andy Shevchenko
2021-05-21 16:10 ` Mathieu Poirier [this message]
2021-05-21 16:10 ` Mathieu Poirier
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=20210521161044.GA997016@xps15 \
--to=mathieu.poirier@linaro.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=suzuki.poulose@arm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.