summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2021-06-10 10:22:39 +0800
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-06-11 20:44:07 +0200
commitbb89d137b2ed2a94df83cd468b0b1d473811c6bb (patch)
tree33c42b4b809dc6c78535b396132ede79d3880edc /drivers/mtd
parent4883307c6d8e59018a661ad1fa1e9c62328d6150 (diff)
downloadlinux-bb89d137b2ed2a94df83cd468b0b1d473811c6bb.tar.bz2
mtd: esb2rom: remove unnecessary oom message
Fixes scripts/checkpatch.pl warning: WARNING: Possible unnecessary 'out of memory' message Remove it can help us save a bit of memory. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210610022239.15238-1-thunder.leizhen@huawei.com
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/maps/esb2rom.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c
index 85e14150a073..15d5b76ff504 100644
--- a/drivers/mtd/maps/esb2rom.c
+++ b/drivers/mtd/maps/esb2rom.c
@@ -277,11 +277,10 @@ static int __init esb2rom_init_one(struct pci_dev *pdev,
unsigned long offset;
int i;
- if (!map)
- map = kmalloc(sizeof(*map), GFP_KERNEL);
if (!map) {
- printk(KERN_ERR MOD_NAME ": kmalloc failed");
- goto out;
+ map = kmalloc(sizeof(*map), GFP_KERNEL);
+ if (!map)
+ goto out;
}
memset(map, 0, sizeof(*map));
INIT_LIST_HEAD(&map->list);