Commit df76431b11396b940b5aa9b25edd5b0a33b18911

Authored by Heinrich Schuchardt
Committed by Alexander Graf
1 parent 1bfb1579be

efi_driver: set DM_FLAG_NAME_ALLOCED flag

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@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

lib/efi_driver/efi_block_device.c
... ... @@ -161,6 +161,8 @@
161 161 return ret;
162 162 if (!bdev)
163 163 return -ENOENT;
  164 + /* Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak */
  165 + device_set_name_alloced(bdev);
164 166 /* Allocate priv */
165 167 ret = device_probe(bdev);
166 168 if (ret)