]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: pl061: handle failed allocations
authorNicholas Mc Guire <hofrat@osadl.org>
Sat, 1 Dec 2018 11:57:18 +0000 (12:57 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 10 Jan 2019 14:54:50 +0000 (15:54 +0100)
commit6a2e080550c1bb05e3e359b1e7bedcda18385bf8
treebeec4c95f841a5903a5f4a5a2101e48be8958974
parentd6952d4b95d3a6897fcea7446c97f59f8d24556b
gpio: pl061: handle failed allocations

devm_kzalloc(), devm_kstrdup() and devm_kasprintf() all can
fail internal allocation and return NULL. Using any of the assigned
objects without checking is not safe. As this is early in the boot
phase and these allocations really should not fail, any failure here
is probably an indication of a more serious issue so it makes little
sense to try and rollback the previous allocated resources or try to
continue;  but rather the probe function is simply exited with -ENOMEM.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: f29defe72505 ("ARM: integrator: add MMCI device to IM-PD1")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/mach-integrator/impd1.c