[ewg] [PATCH 3/5] RDMA/nes: fix for possible crash when RAW QP resources are destroyed

miroslaw.walukiewicz at intel.com miroslaw.walukiewicz at intel.com
Thu Dec 9 08:01:39 PST 2010


Now there is no possibility to crash system when there is a try of release
already released resources

Signed-off-by: Mirek Walukiewicz <miroslaw.walukiewicz at intel.com>
---

 .../fixes/nes_0053_ima_del_rsc_crash_fix.patch     |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 kernel_patches/fixes/nes_0053_ima_del_rsc_crash_fix.patch


diff --git a/kernel_patches/fixes/nes_0053_ima_del_rsc_crash_fix.patch b/kernel_patches/fixes/nes_0053_ima_del_rsc_crash_fix.patch
new file mode 100644
index 0000000..dd7db09
--- /dev/null
+++ b/kernel_patches/fixes/nes_0053_ima_del_rsc_crash_fix.patch
@@ -0,0 +1,20 @@
+diff --git a/drivers/infiniband/hw/nes/nes_ud.c b/drivers/infiniband/hw/nes/nes_ud.c
+index c784fad..0ceb9a2 100644
+--- a/drivers/infiniband/hw/nes/nes_ud.c
++++ b/drivers/infiniband/hw/nes/nes_ud.c
+@@ -371,12 +371,14 @@ static inline int  del_rsc_list(struct nes_ud_file *file)
+ 			"adapter  is NULL\n", __func__, __LINE__);
+ 		return -EFAULT;
+ 	}
++	if (pRsc->num_allocated_nics == 0)
++		return 0;
++
+ 	if (--pRsc->num_allocated_nics == 0) {
+ 		nes_write_indexed(nesdev, 0x60b8, pRsc->original_60b8);
+ 		nes_write_indexed(nesdev, 0x6000, pRsc->original_6000);
+ 		pRsc->num_logport_confed = 0;
+ 	}
+-	BUG_ON(pRsc->num_allocated_nics < 0);
+ 	BUG_ON(file->rsc_idx >= NES_UD_MAX_NIC_CNT);
+ 
+ 	for (i = 0; i < NES_UD_MAX_NIC_CNT; i++) {





More information about the ewg mailing list