io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: Jens Axboe <axboe@kernel.dk>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] io_uring: fix missing error return when percpu_ref_init fails
Date: Fri, 20 Dec 2019 23:49:49 +0000	[thread overview]
Message-ID: <cf270359-fd06-3175-d0ef-ec2adc628235@canonical.com> (raw)
In-Reply-To: <398f514a-e2ce-8b4f-16cf-4edeec5fa1e7@kernel.dk>

On 20/12/2019 23:48, Jens Axboe wrote:
> On 12/20/19 4:33 PM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently when the call to percpu_ref_init fails ctx->file_data is
>> set to null and because there is a missing return statement the
>> following statement dereferences this null pointer causing an oops.
>> Fix this by adding the missing -ENOMEM return to avoid the oops.
> 
> Nice, thanks! I'm guessing I didn't have the necessary magic debug
> options to allow failure injection for failing.

Fortunately we have Coverity to the rescue :-)

Colin



  reply	other threads:[~2019-12-20 23:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 23:33 [PATCH][next] io_uring: fix missing error return when percpu_ref_init fails Colin King
2019-12-20 23:48 ` Jens Axboe
2019-12-20 23:49   ` Colin Ian King [this message]
2019-12-20 23:50     ` Jens Axboe

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=cf270359-fd06-3175-d0ef-ec2adc628235@canonical.com \
    --to=colin.king@canonical.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).