]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mmc: meson-mx-sdio: check devm_kasprintf for failure
authorNicholas Mc Guire <hofrat@osadl.org>
Thu, 22 Nov 2018 09:35:19 +0000 (10:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 19:02:20 +0000 (20:02 +0100)
commit7011f77137659a095697e3bbbe007223d2e0ceb4
tree2bf97399d8bec3575aa234fd99b53272b9a92a3c
parent9b5c08ab3445ce3ec0502b5325dd46c19f16e246
mmc: meson-mx-sdio: check devm_kasprintf for failure

[ Upstream commit b0d06f1cb0e2079a3c64fb6e27c19d9a55c723a1 ]

devm_kasprintf() may return NULL on failure of internal allocation thus
the assignments to  init.name  are not safe if not checked. On error
meson_mx_mmc_register_clks() returns negative values so -ENOMEM in the
(unlikely) failure case of devm_kasprintf() should be fine here.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: ed80a13bb4c4 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoCs")
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/meson-mx-sdio.c