[U-Boot] [PATCH 1/1] efi_driver: set DM_FLAG_NAME_ALLOCED flag
Heinrich Schuchardt
xypron.glpk at gmx.de
Sat Jun 30 05:11:32 UTC 2018
Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak when the block
device is removed.
Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
lib/efi_driver/efi_block_device.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c
index 9c807ff71d..89faae43d0 100644
--- a/lib/efi_driver/efi_block_device.c
+++ b/lib/efi_driver/efi_block_device.c
@@ -161,6 +161,8 @@ static int efi_bl_bind(efi_handle_t handle, void *interface)
return ret;
if (!bdev)
return -ENOENT;
+ /* Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak */
+ device_set_name_alloced(bdev);
/* Allocate priv */
ret = device_probe(bdev);
if (ret)
--
2.18.0
More information about the U-Boot
mailing list