* [PATCH] s390/extmem: Use kmalloc_array() in dcss_set_subcodes()
@ 2016-09-03 14:15 SF Markus Elfring
0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2016-09-03 14:15 UTC (permalink / raw)
To: linux-s390, Christian Bornträger, Heiko Carstens,
Joe Perches, Martin Schwidefsky
Cc: LKML, kernel-janitors, Julia Lawall, Paolo Bonzini
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 3 Sep 2016 16:06:05 +0200
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use 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/mm/extmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c
index 02042b6..4d18301 100644
--- a/arch/s390/mm/extmem.c
+++ b/arch/s390/mm/extmem.c
@@ -102,7 +102,7 @@ static int scode_set;
static int
dcss_set_subcodes(void)
{
- char *name = kmalloc(8 * sizeof(char), GFP_KERNEL | GFP_DMA);
+ char *name = kmalloc_array(8, sizeof(*name), GFP_KERNEL | GFP_DMA);
unsigned long rx, ry;
int rc;
--
2.9.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-03 14:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-03 14:15 [PATCH] s390/extmem: Use kmalloc_array() in dcss_set_subcodes() SF Markus Elfring
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®