Skip to contentSkip to conversation

dma-pool: Fix an uninitialized variable bug in atomic_pool_expand()

PATCH Applied Dan Carpenter 2 participants 2 messages Aug 26, 2020 – Aug 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma-pool: Fix an uninitialized variable bug in atomic_pool_expand()

The "page" pointer can be used with out being initialized.

Fixes d7e673ec2c8e ("dma-pool: Only allocate from CMA when in same memory zone")
---
 kernel/dma/pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/dma/pool.c +1 -1
index 06582b488e31..1281c0f0442b 100644
@@ -84,7 +84,7 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size,
 			      gfp_t gfp)
 {
 	unsigned int order;
-	struct page *page;
+	struct page *page = NULL;
 	void *addr;
 	int ret = -ENOMEM;
 
Signature · 1 line
2.28.0