nvme: Fix wrong ndev->queues memset

memset() was given a sizeof(NVME_Q_NUM * sizeof(struct nvme_queue *)
to clear, which is wrong.

Reported-by: Coverity (CID: 166729)
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Bin Meng 2017-09-02 08:15:35 -07:00 committed by Tom Rini
parent 5eae466ea1
commit 37d46870b3

View file

@ -791,8 +791,7 @@ static int nvme_probe(struct udevice *udev)
printf("Error: %s: Out of memory!\n", udev->name);
goto free_nvme;
}
memset(ndev->queues, 0,
sizeof(NVME_Q_NUM * sizeof(struct nvme_queue *)));
memset(ndev->queues, 0, NVME_Q_NUM * sizeof(struct nvme_queue *));
ndev->prp_pool = malloc(MAX_PRP_POOL);
if (!ndev->prp_pool) {