linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Varun Prakash <varun@chelsio.com>
To: dan.carpenter@oracle.com
Cc: linux-scsi@vger.kernel.org, varun@chelsio.com
Subject: Re: [bug report] scsi: cxgb4i: Add support for iSCSI segmentation offload
Date: Mon, 13 Jul 2020 21:55:02 +0530	[thread overview]
Message-ID: <20200713162501.GB1780@chelsio.com> (raw)
In-Reply-To: <20200710141454.GA135495@mwanda>

On Fri, Jul 10, 2020 at 05:14:54PM +0300, dan.carpenter@oracle.com 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);

  reply	other threads:[~2020-07-13 16:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 14:14 [bug report] scsi: cxgb4i: Add support for iSCSI segmentation offload dan.carpenter
2020-07-13 16:25 ` Varun Prakash [this message]
2020-07-10 14:17 dan.carpenter
2020-07-10 14:29 ` Dan Carpenter
2020-07-13 16:41   ` Varun Prakash
2020-07-20 10:28 dan.carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200713162501.GB1780@chelsio.com \
    --to=varun@chelsio.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).