On Fri, Jul 10, 2020 at 05:14:54PM +0300, dan.carpenter@xxxxxxxxxx wrote: > Hello Varun Prakash, > > This is a semi-automatic email about new static checker warnings. > > The patch e33c2482289b: "scsi: cxgb4i: Add support for iSCSI > segmentation offload" from Jun 29, 2020, leads to the following > Smatch complaint: > > drivers/scsi/cxgbi/libcxgbi.c:1892 cxgbi_conn_alloc_pdu() > warn: variable dereferenced before check 'cconn' (see line 1891) > > drivers/scsi/cxgbi/libcxgbi.c > 1890 struct cxgbi_conn *cconn = tcp_conn->dd_data; > 1891 struct cxgbi_device *cdev = cconn->chba->cdev; > ^^^^^^^^^^^ > Unchecked dereference in old code. > > 1892 struct cxgbi_sock *csk = (cconn && cconn->cep) ? cconn->cep->csk : NULL; > ^^^^^ > New code adds a check for NULL but it's too late. cconn will never be NULL, I will post a patch to remove this NULL check. > > 1893 struct iscsi_tcp_task *tcp_task = task->dd_data; > 1894 struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);