diff --git a/boot/bootctl/bootctl-uclass.c b/boot/bootctl/bootctl-uclass.c
index 756702b3e9a..3f06668a199 100644
--- a/boot/bootctl/bootctl-uclass.c
+++ b/boot/bootctl/bootctl-uclass.c
@@ -8,8 +8,10 @@
 
 #define LOG_CATEGORY	UCLASS_BOOTCTL
 
+#include <abuf.h>
 #include <bootctl.h>
 #include <dm.h>
+#include <expo.h>
 #include <bootctl/ui.h>
 
 UCLASS_DRIVER(bootctrl) = {
@@ -39,9 +41,21 @@ UCLASS_DRIVER(bootctrl_state) = {
 	.per_device_plat_auto	= sizeof(struct bootctl_uc_plat),
 };
 
+static int bootctl_ui_pre_remove(struct udevice *dev)
+{
+	struct bc_ui_priv *upriv = dev_get_uclass_priv(dev);
+
+	if (upriv->expo)
+		expo_destroy(upriv->expo);
+	abuf_uninit(&upriv->autoboot_template);
+
+	return 0;
+}
+
 UCLASS_DRIVER(bootctrl_ui) = {
 	.id		= UCLASS_BOOTCTL_UI,
 	.name		= "bootctrl_ui",
+	.pre_remove	= bootctl_ui_pre_remove,
 	.per_device_plat_auto	= sizeof(struct bootctl_uc_plat),
 	.per_device_auto	= sizeof(struct bc_ui_priv),
 };
