From: Bin Meng Date: Sat, 2 Sep 2017 15:15:35 +0000 (-0700) Subject: nvme: Fix wrong ndev->queues memset X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=37d46870b31724b71f593de3eda274e9ad8026d4;p=u-boot.git 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 Reviewed-by: Tom Rini --- diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c index ec32d0de27..4448754aca 100644 --- a/drivers/nvme/nvme.c +++ b/drivers/nvme/nvme.c @@ -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) {