]> git.baikalelectronics.ru Git - kernel.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)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Dec 2018 07:26:24 +0000 (08:26 +0100)
commitce008ef1c009690e5046caafdf4220fab5d42835
treebc8796c973820d2b6b48457fdb91aaef774ff5b8
parent2b5106ac9bcef1cf3c8071e32c64418942a25b4b
mmc: meson-mx-sdio: check devm_kasprintf for failure

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: 9b6daeb16570 ("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>
drivers/mmc/host/meson-mx-sdio.c