[2/3] efi/esrt: use memunmap rather kfree to free the remapping

Message ID 20171206095010.24170-3-ard.biesheuvel@linaro.org
State New
Headers show
Series
  • EFI fixes for v4.15
Related show

Commit Message

Ard Biesheuvel Dec. 6, 2017, 9:50 a.m.
From: Pan Bian <bianpan2016@163.com>


The remapping result of memremap should be freed with memunmap, not
kfree.

Signed-off-by: Pan Bian <bianpan2016@163.com>

Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 drivers/firmware/efi/esrt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
index 7aae2483fcb9..c47e0c6ec00f 100644
--- a/drivers/firmware/efi/esrt.c
+++ b/drivers/firmware/efi/esrt.c
@@ -428,7 +428,7 @@  static int __init esrt_sysfs_init(void)
 err_remove_esrt:
 	kobject_put(esrt_kobj);
 err:
-	kfree(esrt);
+	memunmap(esrt);
 	esrt = NULL;
 	return error;
 }