All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: niklas.soderlund+renesas@ragnatech.se
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: [bug report] media: rcar-vin: add group allocator functions
Date: Thu, 3 May 2018 15:36:30 +0300	[thread overview]
Message-ID: <20180503123630.GA19539@mwanda> (raw)

Hello Niklas S�derlund,

The patch 3bb4c3bc85bf: "media: rcar-vin: add group allocator
functions" from Apr 14, 2018, leads to the following static checker
warning:

	drivers/media/platform/rcar-vin/rcar-core.c:346 rvin_group_put()
	error: potential NULL dereference 'vin->group'.

drivers/media/platform/rcar-vin/rcar-core.c
   339  static void rvin_group_put(struct rvin_dev *vin)
   340  {
   341          mutex_lock(&vin->group->lock);
   342  
   343          vin->group = NULL;
                ^^^^^^^^^^^^^^^^^
Set to NULL.

   344          vin->v4l2_dev.mdev = NULL;
   345  
   346          if (WARN_ON(vin->group->vin[vin->id] != vin))
                            ^^^^^^^^^^^^^^^^^^^^^^^^
   347                  goto out;
   348  
   349          vin->group->vin[vin->id] = NULL;
                ^^^^^^^^^^^^^^^^^^^^^^^^
   350  out:
   351          mutex_unlock(&vin->group->lock);
                              ^^^^^^^^^^^^^^^^
   352  
   353          kref_put(&vin->group->refcount, rvin_group_release);
                          ^^^^^^^^^^^^^^^^^^^^

There are a bunch of NULL dereferences here...

   354  }

regards,
dan carpenter

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: niklas.soderlund+renesas@ragnatech.se
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: [bug report] media: rcar-vin: add group allocator functions
Date: Thu, 3 May 2018 15:36:30 +0300	[thread overview]
Message-ID: <20180503123630.GA19539@mwanda> (raw)

Hello Niklas Söderlund,

The patch 3bb4c3bc85bf: "media: rcar-vin: add group allocator
functions" from Apr 14, 2018, leads to the following static checker
warning:

	drivers/media/platform/rcar-vin/rcar-core.c:346 rvin_group_put()
	error: potential NULL dereference 'vin->group'.

drivers/media/platform/rcar-vin/rcar-core.c
   339  static void rvin_group_put(struct rvin_dev *vin)
   340  {
   341          mutex_lock(&vin->group->lock);
   342  
   343          vin->group = NULL;
                ^^^^^^^^^^^^^^^^^
Set to NULL.

   344          vin->v4l2_dev.mdev = NULL;
   345  
   346          if (WARN_ON(vin->group->vin[vin->id] != vin))
                            ^^^^^^^^^^^^^^^^^^^^^^^^
   347                  goto out;
   348  
   349          vin->group->vin[vin->id] = NULL;
                ^^^^^^^^^^^^^^^^^^^^^^^^
   350  out:
   351          mutex_unlock(&vin->group->lock);
                              ^^^^^^^^^^^^^^^^
   352  
   353          kref_put(&vin->group->refcount, rvin_group_release);
                          ^^^^^^^^^^^^^^^^^^^^

There are a bunch of NULL dereferences here...

   354  }

regards,
dan carpenter

             reply	other threads:[~2018-05-03 12:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03 12:36 Dan Carpenter [this message]
2018-05-03 12:36 ` [bug report] media: rcar-vin: add group allocator functions Dan Carpenter
2018-05-03 12:53 ` Niklas Söderlund
2018-05-03 12:53   ` Niklas Söderlund

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=20180503123630.GA19539@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    /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.