From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-s390@vger.kernel.org,
"Heiko Carstens" <heiko.carstens@de.ibm.com>,
"Hendrik Brückner" <brueckner@linux.vnet.ibm.com>,
"Martin Schwidefsky" <schwidefsky@de.ibm.com>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
"Julia Lawall" <julia.lawall@lip6.fr>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH] s390/cpum_cf: Use kmalloc_array() in merge_attr()
Date: Mon, 5 Sep 2016 13:34:36 +0200 [thread overview]
Message-ID: <20160905113436.GA4502@linux.vnet.ibm.com> (raw)
In-Reply-To: <97bb5de4-f9c1-1e2c-cf39-3ecfee114d52@users.sourceforge.net>
On Sat, Sep 03, 2016 at 03:27:42PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 3 Sep 2016 15:17:45 +0200
>
> * A multiplication for the size determination of a memory allocation
> indicated that an array data structure should be processed.
> Thus reuse the corresponding function "kmalloc_array".
>
> * Replace the specification of a data type by a pointer dereference
> to make the corresponding size determination a bit safer according to
> the Linux coding style convention.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> arch/s390/kernel/perf_cpum_cf_events.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/s390/kernel/perf_cpum_cf_events.c b/arch/s390/kernel/perf_cpum_cf_events.c
> index 4554a4b..0d6340b 100644
> --- a/arch/s390/kernel/perf_cpum_cf_events.c
> +++ b/arch/s390/kernel/perf_cpum_cf_events.c
> @@ -274,7 +274,7 @@ static __init struct attribute **merge_attr(struct attribute **a,
> j++;
> j++;
>
> - new = kmalloc(sizeof(struct attribute *) * j, GFP_KERNEL);
> + new = kmalloc_array(j, sizeof(*new), GFP_KERNEL);
> if (!new)
> return NULL;
> j = 0;
> --
Looks good to me. Thanks.
Acked-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
prev parent reply other threads:[~2016-09-05 11:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-03 13:27 [PATCH] s390/cpum_cf: Use kmalloc_array() in merge_attr() SF Markus Elfring
2016-09-05 11:34 ` Hendrik Brueckner [this message]
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=20160905113436.GA4502@linux.vnet.ibm.com \
--to=brueckner@linux.vnet.ibm.com \
--cc=elfring@users.sourceforge.net \
--cc=heiko.carstens@de.ibm.com \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=schwidefsky@de.ibm.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