]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l2-fwnode: use the cached value instead of getting again
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Oct 2017 18:18:03 +0000 (14:18 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 1 Nov 2017 09:10:36 +0000 (05:10 -0400)
commitc62f3f12cb2a33d66e31302416b21df4ded3fd7c
treea499e2bdb32546cb96015b4f6bce8d8be1023225
parentd788c234d768140409c2092ddc281aa34a9b6993
media: v4l2-fwnode: use the cached value instead of getting again

There is a get/put operation in order to get firmware is_available
data there at the __v4l2_async_notifier_parse_fwnode_endpoints()
function. However, instead of using it, the code just reads again
without the lock. That's a bug, as dev_fwnode isn't guaranteed
to be there once fwnode_handle_put() has been called on it.

This solves this smatch warning:

drivers/media/v4l2-core/v4l2-fwnode.c:453:8: warning: variable 'is_available' set but not used [-Wunused-but-set-variable]
   bool is_available;
        ^~~~~~~~~~~~

Fixes: f2cf51db85aa ("media: v4l: fwnode: Support generic parsing of graph endpoints in a device")
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/v4l2-fwnode.c