diff options
| author | Francois Berder <[email protected]> | 2026-05-09 22:13:31 +0200 |
|---|---|---|
| committer | Neil Armstrong <[email protected]> | 2026-05-20 09:44:37 +0200 |
| commit | 63f0f19803ee28a3612dfbef719ae7bac5143eef (patch) | |
| tree | 7efc32c9f688b5a800fc43f1fcf472c6f2993610 | |
| parent | d6eb327828a384c3bf325de05633a77f66688f53 (diff) | |
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 <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://patch.msgid.link/BESP194MB280542535B098A33C8A815EEDA3A2@BESP194MB2805.EURP194.PROD.OUTLOOK.COM
Signed-off-by: Neil Armstrong <[email protected]>
| -rw-r--r-- | drivers/nvme/nvme_apple.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |
