* [PATCH] mtd/inftlmount: Delete error messages for a failed memory allocation in two functions
@ 2018-01-03 20:52 SF Markus Elfring
0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2018-01-03 20:52 UTC (permalink / raw)
To: linux-mtd, Boris Brezillon, Brian Norris, Cyrille Pitchen,
David Woodhouse, Marek Vasut, Richard Weinberger
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 3 Jan 2018 21:45:19 +0100
Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/mtd/inftlmount.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
index 8d6bb189ea8e..e5dd55021602 100644
--- a/drivers/mtd/inftlmount.c
+++ b/drivers/mtd/inftlmount.c
@@ -273,19 +273,12 @@ static int find_boot_record(struct INFTLrecord *inftl)
/* Memory alloc */
inftl->PUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL);
- if (!inftl->PUtable) {
- printk(KERN_WARNING "INFTL: allocation of PUtable "
- "failed (%zd bytes)\n",
- inftl->nb_blocks * sizeof(u16));
+ if (!inftl->PUtable)
return -ENOMEM;
- }
inftl->VUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL);
if (!inftl->VUtable) {
kfree(inftl->PUtable);
- printk(KERN_WARNING "INFTL: allocation of VUtable "
- "failed (%zd bytes)\n",
- inftl->nb_blocks * sizeof(u16));
return -ENOMEM;
}
@@ -562,12 +555,8 @@ int INFTL_mount(struct INFTLrecord *s)
/* Temporary buffer to store ANAC numbers. */
ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL);
- if (!ANACtable) {
- printk(KERN_WARNING "INFTL: allocation of ANACtable "
- "failed (%zd bytes)\n",
- s->nb_blocks * sizeof(u8));
+ if (!ANACtable)
return -ENOMEM;
- }
/*
* First pass is to explore each physical unit, and construct the
--
2.15.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-01-03 20:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-03 20:52 [PATCH] mtd/inftlmount: Delete error messages for a failed memory allocation in two functions 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
Powered by JetHome