diff mbox series

[next] scsi: cxgb4i: remove an unnecessary NULL check for 'cconn' pointer

Message ID 1594741751-3323-1-git-send-email-varun@chelsio.com (mailing list archive)
State Mainlined
Commit ba8ca097089b1372d36d5b789c231b6c2c797d31
Headers show
Series [next] scsi: cxgb4i: remove an unnecessary NULL check for 'cconn' pointer | expand

Commit Message

Varun Prakash July 14, 2020, 3:49 p.m. UTC
'cconn' will never be NULL in cxgbi_conn_alloc_pdu() so
remove NULL check.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Varun Prakash <varun@chelsio.com>
---
 drivers/scsi/cxgbi/libcxgbi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen July 15, 2020, 10:14 p.m. UTC | #1
On Tue, 14 Jul 2020 21:19:11 +0530, Varun Prakash wrote:

> 'cconn' will never be NULL in cxgbi_conn_alloc_pdu() so
> remove NULL check.

Applied to 5.9/scsi-queue, thanks!

[1/1] scsi: cxgb4i: Remove an unnecessary NULL check for 'cconn' pointer
      https://git.kernel.org/mkp/scsi/c/ba8ca097089b
diff mbox series

Patch

diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 1fb101c..8756482 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -1889,7 +1889,7 @@  int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 op)
 	struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
 	struct cxgbi_conn *cconn = tcp_conn->dd_data;
 	struct cxgbi_device *cdev = cconn->chba->cdev;
-	struct cxgbi_sock *csk = (cconn && cconn->cep) ? cconn->cep->csk : NULL;
+	struct cxgbi_sock *csk = cconn->cep ? cconn->cep->csk : NULL;
 	struct iscsi_tcp_task *tcp_task = task->dd_data;
 	struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
 	struct scsi_cmnd *sc = task->sc;