瀏覽代碼

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>
Konrad Rzeszutek Wilk 15 年之前
父節點
當前提交
a12415ff58
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      drivers/firmware/iscsi_ibft.c

+ 4 - 2
drivers/firmware/iscsi_ibft.c

@@ -727,8 +727,10 @@ static void ibft_unregister(void)
 
 
 static void ibft_cleanup(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)
 static void __exit ibft_exit(void)