dma-pool: Fix an uninitialized variable bug in atomic_pool_expand()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 26 Aug 2020 11:33:30 +0000 (14:33 +0300)
committerChristoph Hellwig <hch@lst.de>
Thu, 27 Aug 2020 07:22:56 +0000 (09:22 +0200)
The "page" pointer can be used with out being initialized.

Fixes: d7e673ec2c8e ("dma-pool: Only allocate from CMA when in same memory zone")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
kernel/dma/pool.c

index 06582b488e3174be9aeefe7ab68cc33f407a240a..1281c0f0442bc51018b76b2b2e86a79be65829dd 100644 (file)
@@ -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;