mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Colin Ian King <colin.king@canonical.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: media: rcar-vin: add group allocator functions
Date: Wed, 25 Apr 2018 00:35:54 +0200	[thread overview]
Message-ID: <20180424223554.GE27674@bigcity.dyn.berto.se> (raw)
In-Reply-To: <12ca5ca8-a582-5899-6dd5-c064e4b54e2b@canonical.com>

Hi Colin,

Thanks for reporting this. I wonder why smatch and sparse did not catch 
this, the fault can't be mine for writing such a obviously bad thing 
right :-)

I have a patch to address this, just need to test it before posting.

On 2018-04-24 14:14:02 +0100, Colin Ian King wrote:
> Hi there,
> 
> While running static analysis on linux-next today a null pointer
> dereference issue was detected by CoverityScan. The following commit
> introduced the issue:
> 
> commit 3bb4c3bc85bf77a76c921671800bde2e1bf82a88
> Author: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Date:   Sat Apr 14 07:57:18 2018 -0400
> 
>     media: rcar-vin: add group allocator functions
> 
> The analysis is as follows:
> 
> 339 static void rvin_group_put(struct rvin_dev *vin)
> 340 {
> 341        mutex_lock(&vin->group->lock);
> 342
>    1. assign_zero: Assigning: vin->group = NULL.
> 
> 343        vin->group = NULL;
> 344        vin->v4l2_dev.mdev = NULL;
> 345
>     CID 1468359 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
>     2. var_deref_op: Dereferencing null pointer vin->group.
> 
> 346        if (WARN_ON(vin->group->vin[vin->id] != vin))
> 347                goto out;
> 348
> 
> vin->group is NULL however the WARN_ON is dereferencing it, causing an
> OOPS.  I don't know how this should be fixed, hence I am sending this
> bug report.
> 
> Regards,
> 
> Colin

-- 
Regards,
Niklas Söderlund

  reply	other threads:[~2018-04-24 22:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-24 13:14 Colin Ian King
2018-04-24 22:35 ` Niklas Söderlund [this message]
2018-05-02  8:46 Colin Ian King

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=20180424223554.GE27674@bigcity.dyn.berto.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=colin.king@canonical.com \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    /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

all inboxes | Powered by JetHome®