Skip to contentSkip to conversation

staging/rdma/hfi1: Fix for module parameter hdrq_entsize when it's 0

PATCH In review Mike Marciniszyn 2 participants 2 messages Dec 10, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging/rdma/hfi1: Fix for module parameter hdrq_entsize when it's 0

From: Sebastian Sanchez <[email protected]>

If driver is loaded with parameter hdrq_entsize=0, then there's a NULL dereference when the driver gets unloaded. This causes a kernel Oops and prevents the module from being unloaded. This patch fixes this issue by making sure -EINVAL gets returned when hdrq_entsize=0.

---
 drivers/staging/rdma/hfi1/init.c |    1 +
 1 file changed, 1 insertion(+)
drivers/staging/rdma/hfi1/init.c +1 -0
index 1c8286f..b61a854 100644
@@ -1350,6 +1350,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (!encode_rcv_header_entry_size(hfi1_hdrq_entsize)) {
 		hfi1_early_err(&pdev->dev, "Invalid HdrQ Entry size %u\n",
 			       hfi1_hdrq_entsize);
+		ret = -EINVAL;
 		goto bail;
 	}
 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw

Hi Mike,

Quoted 2 lines · On Thu, 10 Dec 2015 16:02:49 -0500 Mike Marciniszyn…

From: Sebastian Sanchez <[email protected]>

linux-nxt doesn't really need to be informed about random changes to stuff in staging unless it fixes a linux-next specific problem.

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]