[bug report] scsi: cxgb4i: Add support for iSCSI segmentation offload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:2158 cxgbi_conn_init_pdu()
    warn: variable dereferenced before check 'tdata' (see line 2150)

drivers/scsi/cxgbi/libcxgbi.c
  2149		struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
  2150		struct sk_buff *skb = tdata->skb;
                                      ^^^^^^^^^^
The old code doesn't check for NULL.

  2151		struct scsi_cmnd *sc = task->sc;
  2152		u32 expected_count, expected_offset;
  2153		u32 datalen = count, dlimit = 0;
  2154		u32 i, padlen = iscsi_padding(count);
  2155		struct page *pg;
  2156		int err;
  2157	
  2158		if (!tcp_task || !tdata || tcp_task->dd_data != tdata) {
                                 ^^^^^^
The new check is too late.

  2159			pr_err("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n",
  2160			       task, task->sc, tcp_task,

regards,
dan carpenter



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux