linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Herrmann <dh.herrmann@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Daniel Mack <daniel@zonque.org>,
	David Herrmann <dh.herrmann@googlemail.com>,
	Djalal Harouni <tixxdz@opendz.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] kdbus: checking for IS_ERR() instead of NULL
Date: Wed, 22 Apr 2015 19:35:11 +0200	[thread overview]
Message-ID: <CANq1E4RA33bqBUi=27mOX4Wh03k5suNQpgQAFjX68rW-EuVXHg@mail.gmail.com> (raw)
In-Reply-To: <20150422133900.GB29383@mwanda>

Hi

On Wed, Apr 22, 2015 at 3:39 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> "e->user" is never assigned an ERR_PTR().  It can be set to NULL so I
> assume that is what is intended here.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/ipc/kdbus/queue.c b/ipc/kdbus/queue.c
> index a449464..21fce62 100644
> --- a/ipc/kdbus/queue.c
> +++ b/ipc/kdbus/queue.c
> @@ -637,7 +637,7 @@ int kdbus_queue_entry_move(struct kdbus_queue_entry *e,
>         lockdep_assert_held(&src->lock);
>         lockdep_assert_held(&dst->lock);
>
> -       if (WARN_ON(IS_ERR(e->user)) || WARN_ON(list_empty(&e->entry)))
> +       if (WARN_ON(!e->user) || WARN_ON(list_empty(&e->entry)))

e->user is allowed to be NULL (eg., for kernel notifications). We used
to set it to ERR_PTR(foobar), but that's long gone. This WARN_ON() can
simply be dropped.

I wrote a patch [1] and will send it to Greg later.

Thanks
David

[1] http://cgit.freedesktop.org/~dvdhrm/linux/commit/?h=kdbus&id=eb132dd85d4e882a9b3ad07497b26d1b55cab893

>                 return -EINVAL;
>         if (src == dst)
>                 return 0;

  reply	other threads:[~2015-04-22 17:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 13:39 [patch] kdbus: checking for IS_ERR() instead of NULL Dan Carpenter
2015-04-22 17:35 ` David Herrmann [this message]
2015-04-22 18:44   ` 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='CANq1E4RA33bqBUi=27mOX4Wh03k5suNQpgQAFjX68rW-EuVXHg@mail.gmail.com' \
    --to=dh.herrmann@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel@zonque.org \
    --cc=dh.herrmann@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tixxdz@opendz.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).