diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index a6c670b8ce52..d4ed8e98edf7 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -133,7 +133,7 @@ config ISCSI_BOOT_SYSFS config ISCSI_IBFT tristate "iSCSI Boot Firmware Table Attributes module" select ISCSI_BOOT_SYSFS - depends on ISCSI_IBFT_FIND + depends on ISCSI_IBFT_FIND && SCSI default n help This option enables support for detection and exposing of iSCSI diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index 4f04ec0410a0..6148a1c67895 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c @@ -727,8 +727,10 @@ static void ibft_unregister(void) static void ibft_cleanup(void) { - ibft_unregister(); - iscsi_boot_destroy_kset(boot_kset); + if (boot_kset) { + ibft_unregister(); + iscsi_boot_destroy_kset(boot_kset); + } } static void __exit ibft_exit(void)