public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ayush.sawal@chelsio.com
Cc: kernel-janitors@vger.kernel.org
Subject: [bug report] cxgb4/ch_ktls: Clear resources when pf4 device is removed
Date: Sat, 15 May 2021 13:42:53 +0300	[thread overview]
Message-ID: <YJ+lregUoryep/Ix@mwanda> (raw)

Hello Ayush Sawal,

This is a semi-automatic email about new static checker warnings.

The patch 65e302a9bd57: "cxgb4/ch_ktls: Clear resources when pf4 
device is removed" from May 13, 2021, leads to the following Smatch 
complaint:

    drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c:393 chcr_ktls_dev_del()
    error: we previously assumed 'u_ctx' could be null (see line 374)

drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c
   373		u_ctx = tx_info->adap->uld[CXGB4_ULD_KTLS].handle;
   374		if (u_ctx && u_ctx->detach)
                    ^^^^^
Can u_ctx be NULL?

   375			return;
   376		/* clear l2t entry */
   377		if (tx_info->l2te)
   378			cxgb4_l2t_release(tx_info->l2te);
   379	
   380	#if IS_ENABLED(CONFIG_IPV6)
   381		/* clear clip entry */
   382		if (tx_info->ip_family == AF_INET6)
   383			cxgb4_clip_release(netdev, (const u32 *)
   384					   &tx_info->sk->sk_v6_rcv_saddr,
   385					   1);
   386	#endif
   387	
   388		/* clear tid */
   389		if (tx_info->tid != -1) {
   390			cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan,
   391					 tx_info->tid, tx_info->ip_family);
   392	
   393			xa_erase(&u_ctx->tid_list, tx_info->tid);
                                 ^^^^^^^^^^^^^^^^
Unchecked dereference.

   394		}
   395	

regards,
dan carpenter

             reply	other threads:[~2021-05-15 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-15 10:42 Dan Carpenter [this message]
2021-05-17 10:18 ` [bug report] cxgb4/ch_ktls: Clear resources when pf4 device is removed Ayush Sawal

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=YJ+lregUoryep/Ix@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ayush.sawal@chelsio.com \
    --cc=kernel-janitors@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