lkml.org 
[lkml]   [2018]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectre: media: rcar-vin: add group allocator functions
Date
Hi there,

Static analysis with CoverityScan picked up an explicit null pointer
dereference in the the following commit:

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

in:

+static void rvin_group_put(struct rvin_dev *vin)
+{
+ mutex_lock(&vin->group->lock);
+
+ vin->group = NULL;

vin->group is now NULL


+ vin->v4l2_dev.mdev = NULL;
+
+ if (WARN_ON(vin->group->vin[vin->id] != vin))
+ goto out;

vin->group is being dereferenced (null pointer dereference)

+
+ vin->group->vin[vin->id] = NULL;

vin->group is being dereferenced (null pointer dereference)

+out:
+ mutex_unlock(&vin->group->lock);
+
+ kref_put(&vin->group->refcount, rvin_group_release);
+}

So I think this needs fixing up.

Regards,

Colin

\
 
 \ /
  Last update: 2018-05-02 10:46    [W:0.033 / U:4.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site