From: Francois Berder Date: Sat, 9 May 2026 20:13:31 +0000 (+0200) Subject: nvme: apple: Check memalign return value X-Git-Tag: v2026.07-rc3~9^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63f0f19803ee28a3612dfbef719ae7bac5143eef;p=thirdparty%2Fu-boot.git nvme: apple: Check memalign return value memalign returns NULL if it fails. This commit ensures that we handle this failure before filling the buffer with 0s. Signed-off-by: Francois Berder Reviewed-by: Neil Armstrong Link: https://patch.msgid.link/BESP194MB280542535B098A33C8A815EEDA3A2@BESP194MB2805.EURP194.PROD.OUTLOOK.COM Signed-off-by: Neil Armstrong --- diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c index 3e7d95c2b54..e674eda8344 100644 --- a/drivers/nvme/nvme_apple.c +++ b/drivers/nvme/nvme_apple.c @@ -88,6 +88,9 @@ static int apple_nvme_setup_queue(struct nvme_queue *nvmeq) } priv->tcbs[nvmeq->qid] = (void *)memalign(4096, ANS_NVMMU_TCB_SIZE); + if (!priv->tcbs[nvmeq->qid]) + return -ENOMEM; + memset((void *)priv->tcbs[nvmeq->qid], 0, ANS_NVMMU_TCB_SIZE); switch (nvmeq->qid) {