[bug report] media: rcar-vin: add group allocator functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux