mirror of
https://xff.cz/git/u-boot/
synced 2025-09-30 23:11:32 +02:00
efi_loader: return immediately in UCLASS_EFI_LOADER removal
In case of UCLASS_EFI_LOADER, EFI handles are managed by EFI application/driver, we must not delete EFI handles. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
committed by
Heinrich Schuchardt
parent
0351b659dd
commit
2c98f7435c
@@ -731,8 +731,14 @@ int efi_disk_remove(void *ctx, struct event *event)
|
|||||||
switch (id) {
|
switch (id) {
|
||||||
case UCLASS_BLK:
|
case UCLASS_BLK:
|
||||||
desc = dev_get_uclass_plat(dev);
|
desc = dev_get_uclass_plat(dev);
|
||||||
if (desc && desc->uclass_id != UCLASS_EFI_LOADER)
|
if (desc && desc->uclass_id == UCLASS_EFI_LOADER)
|
||||||
diskobj = (struct efi_disk_obj *)handle;
|
/*
|
||||||
|
* EFI application/driver manages the EFI handle,
|
||||||
|
* no need to delete EFI handle.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
diskobj = (struct efi_disk_obj *)handle;
|
||||||
break;
|
break;
|
||||||
case UCLASS_PARTITION:
|
case UCLASS_PARTITION:
|
||||||
diskobj = (struct efi_disk_obj *)handle;
|
diskobj = (struct efi_disk_obj *)handle;
|
||||||
@@ -744,10 +750,8 @@ int efi_disk_remove(void *ctx, struct event *event)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (diskobj) {
|
dp = diskobj->dp;
|
||||||
dp = diskobj->dp;
|
volume = diskobj->volume;
|
||||||
volume = diskobj->volume;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = efi_delete_handle(handle);
|
ret = efi_delete_handle(handle);
|
||||||
/* Do not delete DM device if there are still EFI drivers attached. */
|
/* Do not delete DM device if there are still EFI drivers attached. */
|
||||||
|
Reference in New Issue
Block a user