[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b1a2dd0d-6723-bfc3-ae6c-ae4d1f8d4f3b@codeaurora.org>
Date: Thu, 10 Aug 2017 12:17:47 -0400
From: Sinan Kaya <okaya@...eaurora.org>
To: Anton Vasilyev <vasilyev@...ras.ru>,
Andy Gross <andy.gross@...aro.org>
Cc: David Brown <david.brown@...aro.org>,
Dan Williams <dan.j.williams@...el.com>,
Vinod Koul <vinod.koul@...el.com>,
linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org,
dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
ldv-project@...uxtesting.org
Subject: Re: [PATCH] dmaengine: qcom_hidma: avoid freeing an uninitialized
pointer
On 8/10/2017 11:54 AM, Anton Vasilyev wrote:
> If device_node np doesn't contain child or first child doesn't have
> property "reg" then hidma_mgmt_of_populate_channels() perfoms
> deallocation on uninitialized local variable res.
>
> The patch adds res initialization by NULL.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Anton Vasilyev <vasilyev@...ras.ru>
> ---
> drivers/dma/qcom/hidma_mgmt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/qcom/hidma_mgmt.c b/drivers/dma/qcom/hidma_mgmt.c
> index 5a0991b..89e36e3 100644
> --- a/drivers/dma/qcom/hidma_mgmt.c
> +++ b/drivers/dma/qcom/hidma_mgmt.c
> @@ -354,7 +354,7 @@ static int __init hidma_mgmt_of_populate_channels(struct device_node *np)
> struct platform_device_info pdevinfo;
> struct of_phandle_args out_irq;
> struct device_node *child;
> - struct resource *res;
> + struct resource *res = NULL;
> const __be32 *cell;
> int ret = 0, size, i, num;
> u64 addr, addr_size;
>
Reviewed-by: Sinan Kaya <okaya@...eaurora.org>
--
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
Powered by blists - more mailing lists