All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 03/14] nvme: Fix ndev->queues allocation
Date: Tue, 22 Aug 2017 08:15:08 -0700	[thread overview]
Message-ID: <1503414919-30820-4-git-send-email-bmeng.cn@gmail.com> (raw)
In-Reply-To: <1503414919-30820-1-git-send-email-bmeng.cn@gmail.com>

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>
---

 drivers/nvme/nvme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index 2ac0870..5d39cab 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -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) {
-- 
2.9.2

  parent reply	other threads:[~2017-08-22 15:15 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 15:15 [U-Boot] [PATCH 00/14] nvme: Various bug fixes and updates Bin Meng
2017-08-22 15:15 ` [U-Boot] [PATCH 01/14] nvme: Remove useless defines Bin Meng
2017-08-29  2:55   ` [U-Boot] [U-Boot,01/14] " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 02/14] nvme: Fix getting PCI vendor id of the NVMe block device Bin Meng
2017-08-29  2:55   ` [U-Boot] [U-Boot, " Tom Rini
2017-08-22 15:15 ` Bin Meng [this message]
2017-08-29  2:55   ` [U-Boot] [U-Boot,03/14] nvme: Fix ndev->queues allocation Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 04/14] nvme: Fix endianness assignment to prp2 in nvme_identify() Bin Meng
2017-08-29  2:55   ` [U-Boot] [U-Boot, " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 05/14] nvme: Cache controller's capabilities Bin Meng
2017-08-29  2:55   ` [U-Boot] [U-Boot,05/14] " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 06/14] nvme: Respect timeout when en/disabling the controller Bin Meng
2017-08-29  2:56   ` [U-Boot] [U-Boot, " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 07/14] nvme: Use macros to access NVMe queues Bin Meng
2017-08-29  2:56   ` [U-Boot] [U-Boot,07/14] " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 08/14] nvme: Consolidate block read and write routines Bin Meng
2017-08-29  2:56   ` [U-Boot] [U-Boot, " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 09/14] nvme: Apply cache operations on the DMA buffers Bin Meng
2017-08-29  2:56   ` [U-Boot] [U-Boot, " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 10/14] nvme: Use blk_create_devicef() API Bin Meng
2017-08-29  2:56   ` [U-Boot] [U-Boot,10/14] " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 11/14] nvme: Get rid of the global variable nvme_info Bin Meng
2017-08-29  2:56   ` [U-Boot] [U-Boot, " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 12/14] nvme: Adjust the 'nvme' command to use blk_common_cmd() Bin Meng
2017-08-29  2:56   ` [U-Boot] [U-Boot, " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 13/14] sandbox: Add a dummy invalidate_dcache_range() function Bin Meng
2017-08-29  2:56   ` [U-Boot] [U-Boot, " Tom Rini
2017-08-22 15:15 ` [U-Boot] [PATCH 14/14] sandbox: Enable NVMe driver for build testing Bin Meng
2017-08-29  2:56   ` [U-Boot] [U-Boot, " Tom Rini
2017-08-25  1:14 ` [U-Boot] [PATCH 00/14] nvme: Various bug fixes and updates Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503414919-30820-4-git-send-email-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.