Commit a63efead authored by Anton Vasilyev's avatar Anton Vasilyev Committed by Vinod Koul

dmaengine: qcom_hidma: avoid freeing an uninitialized pointer

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: default avatarAnton Vasilyev <vasilyev@ispras.ru>
Reviewed-by: default avatarSinan Kaya <okaya@codeaurora.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 8e734175
...@@ -358,7 +358,7 @@ static int __init hidma_mgmt_of_populate_channels(struct device_node *np) ...@@ -358,7 +358,7 @@ static int __init hidma_mgmt_of_populate_channels(struct device_node *np)
struct platform_device_info pdevinfo; struct platform_device_info pdevinfo;
struct of_phandle_args out_irq; struct of_phandle_args out_irq;
struct device_node *child; struct device_node *child;
struct resource *res; struct resource *res = NULL;
const __be32 *cell; const __be32 *cell;
int ret = 0, size, i, num; int ret = 0, size, i, num;
u64 addr, addr_size; u64 addr, addr_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment