From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
jdike@addtoit.com, richard@nod.at, rppt@linux.vnet.ibm.com,
akpm@linux-foundation.org, yuehaibing@huawei.com,
keescook@chromium.org
Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2] um: vector: Use 'kmalloc_array' instead of 'kmalloc'
Date: Wed, 2 Jan 2019 16:34:22 +0000 [thread overview]
Message-ID: <49451efd-0984-ab88-eef9-4dfd8b8473a7@cambridgegreys.com> (raw)
In-Reply-To: <20181226075449.11071-1-christophe.jaillet@wanadoo.fr>
On 12/26/18 7:54 AM, Christophe JAILLET wrote:
> Use 'kmalloc_array' instead of 'kmalloc' when appropriate.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> I don't know why it has not already been replaced in 6da2ec56059c
> ("treewide: kmalloc() -> kmalloc_array()".
> ---
> arch/um/drivers/vector_kern.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
> index 5b917716289d..dee5246bda81 100644
> --- a/arch/um/drivers/vector_kern.c
> +++ b/arch/um/drivers/vector_kern.c
> @@ -507,12 +507,12 @@ static struct vector_queue *create_queue(
> return NULL;
> result->max_depth = max_size;
> result->dev = vp->dev;
> - result->mmsg_vector = kmalloc(
> - (sizeof(struct mmsghdr) * max_size), GFP_KERNEL);
> + result->mmsg_vector = kmalloc_array(max_size, sizeof(struct mmsghdr),
> + GFP_KERNEL);
> if (result->mmsg_vector == NULL)
> goto out_mmsg_fail;
> - result->skbuff_vector = kmalloc(
> - (sizeof(void *) * max_size), GFP_KERNEL);
> + result->skbuff_vector = kmalloc_array(max_size, sizeof(void *),
> + GFP_KERNEL);
> if (result->skbuff_vector == NULL)
> goto out_skb_fail;
>
>
Acked-by: Anton Ivanov <anton.ivanov at cambridgegreys.com>
--
Anton R. Ivanov
Cambridge Greys Limited, England and Wales company No 10273661
http://www.cambridgegreys.com/
next prev parent reply other threads:[~2019-01-02 16:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-26 7:54 Christophe JAILLET
2019-01-02 16:34 ` Anton Ivanov [this message]
2019-01-08 23:58 ` Kees Cook
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=49451efd-0984-ab88-eef9-4dfd8b8473a7@cambridgegreys.com \
--to=anton.ivanov@cambridgegreys.com \
--cc=akpm@linux-foundation.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=jdike@addtoit.com \
--cc=keescook@chromium.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=richard@nod.at \
--cc=rppt@linux.vnet.ibm.com \
--cc=yuehaibing@huawei.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 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®