From: Varun Prakash Date: Tue, 14 Jul 2020 15:49:11 +0000 (+0530) Subject: scsi: cxgb4i: Remove an unnecessary NULL check for 'cconn' pointer X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ba8ca097089b1372d36d5b789c231b6c2c797d31;p=linux.git scsi: cxgb4i: Remove an unnecessary NULL check for 'cconn' pointer 'cconn' will never be NULL in cxgbi_conn_alloc_pdu() so remove NULL check. Link: https://lore.kernel.org/r/1594741751-3323-1-git-send-email-varun@chelsio.com Reported-by: Dan Carpenter Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 4c555844b7eb8..932dbd4c4cca7 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;