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

Commit cc74e31d authored by Colin Ian King's avatar Colin Ian King Committed by Martin K. Petersen
Browse files

scsi: lpfc: remove null check on nvmebuf



The null checks on nvmebuf are redundant as nvmebuf is always obtained from
a container_of() and hence can never be null. Remove all the redundant null
checks. This also cleans up a static analysis warning.

Detected by CoverityScan, CID#1471753 ("Dereference before null check")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a5445238
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1745,7 +1745,7 @@ lpfc_nvmet_unsol_ls_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
	fc_hdr = (struct fc_frame_header *)(nvmebuf->hbuf.virt);
	oxid = be16_to_cpu(fc_hdr->fh_ox_id);

	if (!nvmebuf || !phba->targetport) {
	if (!phba->targetport) {
		lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
				"6154 LS Drop IO x%x\n", oxid);
		oxid = 0;
@@ -1770,7 +1770,6 @@ lpfc_nvmet_unsol_ls_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
		lpfc_nvmeio_data(phba, "NVMET LS  DROP: "
				 "xri x%x sz %d from %06x\n",
				 oxid, size, sid);
		if (nvmebuf)
		lpfc_in_buf_free(phba, &nvmebuf->dbuf);
		return;
	}
@@ -1814,7 +1813,6 @@ lpfc_nvmet_unsol_ls_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
			ctxp->oxid, rc);

	/* We assume a rcv'ed cmd ALWAYs fits into 1 buffer */
	if (nvmebuf)
	lpfc_in_buf_free(phba, &nvmebuf->dbuf);

	atomic_inc(&tgtp->xmt_ls_abort);