]> git.baikalelectronics.ru Git - kernel.git/commit
drm: sun4i: fix probe error handling
authorArnd Bergmann <arnd@arndb.de>
Thu, 5 May 2016 20:10:52 +0000 (22:10 +0200)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 30 May 2016 06:28:33 +0000 (08:28 +0200)
commit9e3a8f90ff9b86be426456a6c83c9c87a402fc6d
treebc2d8167845a848f0ef9f73cd637d7ecaac26f54
parentf202847be74b97f5ca04c30077fcad8b3982893b
drm: sun4i: fix probe error handling

gcc points out a possible uninitialized variable use in
sun4i_dclk_create():

drivers/gpu/drm/sun4i/sun4i_dotclock.c: In function 'sun4i_dclk_create':
drivers/gpu/drm/sun4i/sun4i_dotclock.c:139:12: error: 'clk_name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  init.name = clk_name;

The warning only shows up when CONFIG_OF is disabled, and the
property is never filled, but the same bug can show up even
when CONFIG_OF is enabled but of_property_read_string_index
returns another error.

To fix it, this ensures that sun4i_dclk_create propagates
any error from of_property_read_string_index.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: e656da9b8498 ("drm: Add Allwinner A10 Display Engine support")
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/gpu/drm/sun4i/sun4i_dotclock.c