mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
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:
committed by
Neil Armstrong
parent
d6eb327828
commit
63f0f19803
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user