• Banajit Goswami's avatar
    component: fix loop condition to call unbind() if bind() fails · 5fba8151
    Banajit Goswami authored
    [ Upstream commit bdae566d ]
    
    During component_bind_all(), if bind() fails for any
    particular component associated with a master, unbind()
    should be called for all previous components in that
    master's match array, whose bind() might have completed
    successfully. As per the current logic, if bind() fails
    for the component at position 'n' in the master's match
    array, it would start calling unbind() from component in
    'n'th position itself and work backwards, and will always
    skip calling unbind() for component in 0th position in the
    master's match array.
    Fix this by updating the loop condition, and the logic to
    refer to the components in master's match array, so that
    unbind() is called for all components starting from 'n-1'st
    position in the array, until (and including) component in
    0th position.
    Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    5fba8151
component.c 13.5 KB