[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20160905113436.GA4502@linux.vnet.ibm.com>
Date: Mon, 5 Sep 2016 13:34:36 +0200
From: Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>
To: SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc: linux-s390@...r.kernel.org,
Heiko Carstens <heiko.carstens@...ibm.com>,
Hendrik Brückner
<brueckner@...ux.vnet.ibm.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>,
Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH] s390/cpum_cf: Use kmalloc_array() in merge_attr()
On Sat, Sep 03, 2016 at 03:27:42PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.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@...rs.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@...ux.vnet.ibm.com>
Powered by blists - more mailing lists