提交 93dd0a09 编写于 作者: T Tadeusz Struk 提交者: Doug Ledford

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: NDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: NTadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 5e9ef246
...@@ -1383,7 +1383,7 @@ static void postinit_cleanup(struct hfi1_devdata *dd) ...@@ -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) static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
int ret = 0, j, pidx, initfail; int ret = 0, j, pidx, initfail;
struct hfi1_devdata *dd = NULL; struct hfi1_devdata *dd = ERR_PTR(-EINVAL);
struct hfi1_pportdata *ppd; struct hfi1_pportdata *ppd;
/* First, lock the non-writable module parameters */ /* First, lock the non-writable module parameters */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册