[PATCH v2] mmc: sunxi: Prevent against null dereference for vmmc

Chen-Yu Tsai wens at csie.org
Thu Oct 20 19:52:23 PDT 2016


On Wed, Oct 19, 2016 at 9:33 PM, Maxime Ripard
<maxime.ripard at free-electrons.com> wrote:
> VMMC is an optional regulator, which means that mmc_regulator_get_supply
> will only return an error in case of a deferred probe, but not when the
> regulator is not set in the DT.
>
> However, the sunxi driver assumes that VMMC is always there, and doesn't
> check the value of the regulator pointer before using it, which obviously
> leads to a (close to) null pointer dereference.
>
> Add proper checks to prevent that.
>
> Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>

Acked-by: Chen-Yu Tsai <wens at csie.org>



More information about the linux-arm-kernel mailing list