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

Commit 93dd0a09 authored by Tadeusz Struk's avatar Tadeusz Struk Committed by Doug Ledford
Browse files

IB/hfi1: Fix potential NULL ptr dereference



This fixes potential NULL ptr dereference because IS_ERR(dd) doesn't
handle NULL. Fix the issue by initializing the pointer with a not NULL
error code.

Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarTadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 5e9ef246
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1383,7 +1383,7 @@ static void postinit_cleanup(struct hfi1_devdata *dd)
static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
	int ret = 0, j, pidx, initfail;
	struct hfi1_devdata *dd = NULL;
	struct hfi1_devdata *dd = ERR_PTR(-EINVAL);
	struct hfi1_pportdata *ppd;

	/* First, lock the non-writable module parameters */