diff mbox

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

Message ID 20151210210249.2436.56776.stgit@phlsvslse11.ph.intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Marciniszyn, Mike Dec. 10, 2015, 9:02 p.m. UTC
From: Sebastian Sanchez <sebastian.sanchez@intel.com>

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.

Reviewed-by: Chegondi, Harish <harish.chegondi@intel.com>
Reviewed-by: Haralanov, Mitko <mitko.haralanov@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
---
 drivers/staging/rdma/hfi1/init.c |    1 +
 1 file changed, 1 insertion(+)


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

Comments

Stephen Rothwell Dec. 10, 2015, 10:42 p.m. UTC | #1
Hi Mike,

On Thu, 10 Dec 2015 16:02:49 -0500 Mike Marciniszyn <mike.marciniszyn@intel.com> wrote:
>
> From: Sebastian Sanchez <sebastian.sanchez@intel.com>

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

Patch

diff --git a/drivers/staging/rdma/hfi1/init.c b/drivers/staging/rdma/hfi1/init.c
index 1c8286f..b61a854 100644
--- a/drivers/staging/rdma/hfi1/init.c
+++ b/drivers/staging/rdma/hfi1/init.c
@@ -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;
 	}