• Arnd Bergmann's avatar
    drm: sun4i: fix probe error handling · 9fa2568d
    Arnd Bergmann authored
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Fixes: 9026e0d1 ("drm: Add Allwinner A10 Display Engine support")
    Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
    9fa2568d
sun4i_dotclock.c 3.67 KB