Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07859def authored by Sebastian Sanchez's avatar Sebastian Sanchez Committed by Greg Kroah-Hartman
Browse files

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



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: default avatarChegondi, Harish <harish.chegondi@intel.com>
Reviewed-by: default avatarHaralanov, Mitko <mitko.haralanov@intel.com>
Signed-off-by: default avatarSebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 859bcad9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1351,6 +1351,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;
	}