提交 62e528b8 编写于 作者: S Sreekanth Reddy 提交者: Martin K. Petersen

scsi: mpi3mr: Fix warnings reported by smatch

Fix the following warning reported by static analysis tool smatch:

smatch warnings:
drivers/scsi/mpi3mr/mpi3mr_os.c:873 mpi3mr_update_tgtdev() error: we
previously assumed 'mrioc->shost' could be null (see line 870

Link: https://lore.kernel.org/r/20210629141153.3158-1-sreekanth.reddy@broadcom.comReported-by: Nkernel test robot <lkp@intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NSreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 df99446d
......@@ -867,8 +867,9 @@ static void mpi3mr_update_tgtdev(struct mpi3mr_ioc *mrioc,
if ((dev_info & MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_MASK) !=
MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_NVME_DEVICE)
tgtdev->is_hidden = 1;
if (mrioc->shost)
prot_mask = scsi_host_get_prot(mrioc->shost);
if (!mrioc->shost)
break;
prot_mask = scsi_host_get_prot(mrioc->shost);
if (prot_mask & SHOST_DIX_TYPE0_PROTECTION) {
scsi_host_set_prot(mrioc->shost, prot_mask & 0x77);
ioc_info(mrioc,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册