]> git.baikalelectronics.ru Git - kernel.git/commit
media: led-class-flash: better handle NULL flash struct
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 1 Nov 2017 21:05:40 +0000 (17:05 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 11 Dec 2017 18:17:22 +0000 (13:17 -0500)
commit510ee42f9a381d1186f1139b216f801fd45c9b47
tree97d400e2ce6212ca717ad3e7cd9bf820cfec8b21
parent6962d6b2184e68c211ffecad7055de8217f834e9
media: led-class-flash: better handle NULL flash struct

The logic at V4L2 led core assumes that the flash struct
can be null. However, it doesn't check for null while
trying to set, causing some smatch  to warn:

drivers/media/v4l2-core/v4l2-flash-led-class.c:210 v4l2_flash_s_ctrl() error: we previously assumed 'fled_cdev' could be null (see line 200)

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
include/linux/led-class-flash.h