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 <fberder@outlook.fr>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/BESP194MB280542535B098A33C8A815EEDA3A2@BESP194MB2805.EURP194.PROD.OUTLOOK.COM
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
This commit is contained in:
Francois Berder
2026-05-09 22:13:31 +02:00
committed by Neil Armstrong
parent d6eb327828
commit 63f0f19803

View File

@@ -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) {