aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware/iscsi_ibft.c
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad@kernel.org>2010-08-11 16:35:40 -0400
committerKonrad Rzeszutek Wilk <konrad@kernel.org>2010-08-11 16:35:40 -0400
commita12415ff589ac5106e6b489f44c947b565fcb963 (patch)
tree9cdcd205ed63e79e68a280160c9f21426ca804c2 /drivers/firmware/iscsi_ibft.c
parent5abd9ccced7a726c817dd6b5b96bc933859138d1 (diff)
ibft: Kernel oops when rmmoding iscsi_ibft with no iBFT present.
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" <jayamohank@serverengines.com>   Tested-by: "Jayamohan Kalickal" <jayamohank@serverengines.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org> Signed-off-by: Peter Jones <pjones@redhat.com>  
Diffstat (limited to 'drivers/firmware/iscsi_ibft.c')
-rw-r--r--drivers/firmware/iscsi_ibft.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 4f04ec0410a..6148a1c6789 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)