Skip to content
  • Nicholas Mc Guire's avatar
    gpio: pl061: handle failed allocations · 83476701
    Nicholas Mc Guire authored
    
    
    [ Upstream commit df209c43a0e8258e096fb722dfbdae4f0dd13fde ]
    
    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: default avatarNicholas Mc Guire <hofrat@osadl.org>
    Fixes: 684284b6
    
     ("ARM: integrator: add MMCI device to IM-PD1")
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    83476701