summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-08-26 16:05:31 +0300
committerTony Lindgren <tony@atomide.com>2019-08-26 18:59:48 +0300
commit50f57ef83d836d727902a6a7e70cca61b0d02655 (patch)
treeffb876df5ddf7aac9e0000fdaec3d8b406ca7c21 /arch/arm/mach-omap2
parentccf4975dca233b1d6a74752d6ab35c239edc0d58 (diff)
downloadlinux-50f57ef83d836d727902a6a7e70cca61b0d02655.tar.xz
ARM: OMAP2+: Delete an unnecessary kfree() call in omap_hsmmc_pdata_init()
A null pointer would be passed to a call of the function "kfree" directly after a call of the function "kzalloc" failed at one place. Remove this superfluous function call. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/hsmmc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 14b9c13c1fa0..63423ea6a240 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -32,10 +32,8 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
char *hc_name;
hc_name = kzalloc(HSMMC_NAME_LEN + 1, GFP_KERNEL);
- if (!hc_name) {
- kfree(hc_name);
+ if (!hc_name)
return -ENOMEM;
- }
snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", c->mmc, 1);
mmc->name = hc_name;