• Jon Hunter's avatar
    regulator: core: Clear the supply pointer if enabling fails · 8e5356a7
    Jon Hunter authored
    During the resolution of a regulator's supply, we may attempt to enable
    the supply if the regulator itself is already enabled. If enabling the
    supply fails, then we will call _regulator_put() for the supply.
    However, the pointer to the supply has not been cleared for the
    regulator and this will cause a crash if we then unregister the
    regulator and attempt to call regulator_put() a second time for the
    supply. Fix this by clearing the supply pointer if enabling the supply
    after fails when resolving the supply for a regulator.
    Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    8e5356a7
core.c 115 KB