linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] test_overflow: fix an IS_ERR() vs NULL bug
Date: Tue, 12 Jun 2018 16:20:02 -0700	[thread overview]
Message-ID: <CAGXu5j+B4=fNbb4yGkFZZfQgPsxTz6C7dO88Pm-VbJBfQEz3Vw@mail.gmail.com> (raw)
In-Reply-To: <20180612120432.xqffkv7q74wnip5n@kili.mountain>

On Tue, Jun 12, 2018 at 5:04 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> root_device_register() returns error pointers, it never returns NULL.
>
> Fixes: ca90800a91ba ("test_overflow: Add memory allocation overflow tests")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Ah! Thanks. I'll pull this into my overflow tree for Linus.

-Kees

>
> diff --git a/lib/test_overflow.c b/lib/test_overflow.c
> index aecbbb217305..2278fe05a1b0 100644
> --- a/lib/test_overflow.c
> +++ b/lib/test_overflow.c
> @@ -367,7 +367,7 @@ static int __init test_overflow_allocation(void)
>
>         /* Create dummy device for devm_kmalloc()-family tests. */
>         dev = root_device_register(device_name);
> -       if (!dev) {
> +       if (IS_ERR(dev)) {
>                 pr_warn("Cannot register test device\n");
>                 return 1;
>         }



-- 
Kees Cook
Pixel Security

      reply	other threads:[~2018-06-12 23:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 12:04 [PATCH] test_overflow: fix an IS_ERR() vs NULL bug Dan Carpenter
2018-06-12 23:20 ` Kees Cook [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='CAGXu5j+B4=fNbb4yGkFZZfQgPsxTz6C7dO88Pm-VbJBfQEz3Vw@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    /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).