All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [bug report] io_uring: add support for sqe links
Date: Mon, 27 May 2019 18:23:16 +0300	[thread overview]
Message-ID: <20190527152316.GJ24680@kadam> (raw)
In-Reply-To: <9b7b794b-26ed-7525-5f81-93cb60e1a005@kernel.dk>

On Mon, May 27, 2019 at 08:34:18AM -0600, Jens Axboe wrote:
> On 5/27/19 8:10 AM, Dan Carpenter wrote:
> > On Mon, May 27, 2019 at 07:36:22AM -0600, Jens Axboe wrote:
> >> On 5/27/19 4:08 AM, Dan Carpenter wrote:
> >>> Hello Jens Axboe,
> >>>
> >>> The patch f3fafe4103bd: "io_uring: add support for sqe links" from
> >>> May 10, 2019, leads to the following static checker warning:
> >>>
> >>> 	fs/io_uring.c:623 io_req_link_next()
> >>> 	error: potential NULL dereference 'nxt'.
> >>>
> >>> fs/io_uring.c
> >>>      614  static void io_req_link_next(struct io_kiocb *req)
> >>>      615  {
> >>>      616          struct io_kiocb *nxt;
> >>>      617
> >>>      618          nxt = list_first_entry_or_null(&req->link_list, struct io_kiocb, list);
> >                                                      ^^^^^^^^^^^^^^^
> > If this list is empty then "nxt" is NULL.
> 
> Right...
> 
> >>>      619          list_del(&nxt->list);
> >>>                             ^^^^^^^^^
> >>> The warning is a false positive but this is a NULL dereference.
> >>>
> >>>      620          if (!list_empty(&req->link_list)) {
> >                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > 
> > We're checking for list_empty() here.
> 
> After deleting an entry from it.
> 

Ah...  Right.  Sorry.

regards,
dan carpenter


      reply	other threads:[~2019-05-27 15:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 10:08 [bug report] io_uring: add support for sqe links Dan Carpenter
2019-05-27 13:36 ` Jens Axboe
2019-05-27 14:10   ` Dan Carpenter
2019-05-27 14:34     ` Jens Axboe
2019-05-27 15:23       ` Dan Carpenter [this message]

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=20190527152316.GJ24680@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=linux-fsdevel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.