* [PATCH] nvme-pci: compile warnings in nvme_alloc_host_mem()
@ 2017-07-06 9:26 Dan Carpenter
2017-07-06 15:28 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-07-06 9:26 UTC (permalink / raw)
"i" should be signed or it could cause a forever loop on the cleanup
path. "size" can be used uninitialized.
Fixes: 87ad72a59a38 ("nvme-pci: implement host memory buffer support")
Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
---
Presumably Arnd already sent a patch for this, but it's been hanging
around linux-next for a while and I want to mark it as dealt with.
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 0ae864b63411..a40675947893 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1585,9 +1585,10 @@ static void nvme_free_host_mem(struct nvme_dev *dev)
static int nvme_alloc_host_mem(struct nvme_dev *dev, u64 min, u64 preferred)
{
struct nvme_host_mem_buf_desc *descs;
- u32 chunk_size, max_entries, i = 0;
+ u32 chunk_size, max_entries;
+ int i = 0;
void **bufs;
- u64 size, tmp;
+ u64 size = 0, tmp;
/* start big and work our way down */
chunk_size = min(preferred, (u64)PAGE_SIZE << MAX_ORDER);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] nvme-pci: compile warnings in nvme_alloc_host_mem()
2017-07-06 9:26 [PATCH] nvme-pci: compile warnings in nvme_alloc_host_mem() Dan Carpenter
@ 2017-07-06 15:28 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2017-07-06 15:28 UTC (permalink / raw)
On Thu, Jul 06, 2017@12:26:52PM +0300, Dan Carpenter wrote:
> "i" should be signed or it could cause a forever loop on the cleanup
> path. "size" can be used uninitialized.
Looks good,
Reviewed-by: Christoph Hellwig <hch at lst.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-06 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-06 9:26 [PATCH] nvme-pci: compile warnings in nvme_alloc_host_mem() Dan Carpenter
2017-07-06 15:28 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox