From a12415ff589ac5106e6b489f44c947b565fcb963 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Wed, 11 Aug 2010 16:35:40 -0400 Subject: ibft: Kernel oops when rmmoding iscsi_ibft with no iBFT present. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We failed to check to see if actually allocated structures to contain the iBFT structure and went ahead to dereference it. This patch fixes the OOPS. Reported-by: "Jayamohan Kalickal"    Tested-by: "Jayamohan Kalickal" Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Peter Jones   --- drivers/firmware/iscsi_ibft.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/firmware') 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) -- cgit v1.2.3 From 4cde752587bab61cedf53fc59ca92787f8612ec0 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Wed, 11 Aug 2010 10:36:20 -0700 Subject: firmware: ibft depends on SCSI Prevent build errors when SCSI is not enabled: iscsi_ibft.c:(.init.text+0x548d): undefined reference to `iscsi_boot_create_initiator' iscsi_ibft.c:(.init.text+0x54a9): undefined reference to `iscsi_boot_create_ethernet' iscsi_ibft.c:(.init.text+0x54c5): undefined reference to `iscsi_boot_create_target' iscsi_ibft.c:(.init.text+0x55ff): undefined reference to `iscsi_boot_destroy_kset' iscsi_ibft.c:(.init.text+0x561e): undefined reference to `iscsi_boot_create_kset' iscsi_ibft.c:(.exit.text+0xe2c): undefined reference to `iscsi_boot_destroy_kset' Signed-off-by: Randy Dunlap Signed-off-by: Peter Jones Signed-off-by: Konrad Rzeszutek Wilk --- drivers/firmware/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/firmware') 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 -- cgit v1.2.3