mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
nvme: Fix ndev->queues allocation
ndev->queues is a pointer to pointer, but the allocation wrongly requests sizeof(struct nvme_queue). Fix it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
e5dc2d2665
commit
099c2015b0
1 changed files with 2 additions and 2 deletions
|
@ -785,13 +785,13 @@ static int nvme_probe(struct udevice *udev)
|
|||
goto free_nvme;
|
||||
}
|
||||
|
||||
ndev->queues = malloc(2 * sizeof(struct nvme_queue));
|
||||
ndev->queues = malloc(2 * sizeof(struct nvme_queue *));
|
||||
if (!ndev->queues) {
|
||||
ret = -ENOMEM;
|
||||
printf("Error: %s: Out of memory!\n", udev->name);
|
||||
goto free_nvme;
|
||||
}
|
||||
memset(ndev->queues, 0, sizeof(2 * sizeof(struct nvme_queue)));
|
||||
memset(ndev->queues, 0, sizeof(2 * sizeof(struct nvme_queue *)));
|
||||
|
||||
ndev->prp_pool = malloc(MAX_PRP_POOL);
|
||||
if (!ndev->prp_pool) {
|
||||
|
|
Loading…
Reference in a new issue