From: Konrad Rzeszutek Wilk Date: Wed, 11 Aug 2010 20:35:40 +0000 (-0400) Subject: ibft: Kernel oops when rmmoding iscsi_ibft with no iBFT present. X-Git-Tag: MMI-PSA29.97-13-9~22544^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a12415ff589ac5106e6b489f44c947b565fcb963;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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"    Tested-by: "Jayamohan Kalickal" Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Peter Jones   --- 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)