aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Vasilyev <vasilyev@ispras.ru>2017-08-10 11:54:25 -0400
committerVinod Koul <vinod.koul@intel.com>2017-08-21 12:21:00 -0400
commita63efead7f8eeefcf08e4e7d0b033ac552f7da23 (patch)
treeffa74d8046933d51f107d2d51854549721d5313c
parent8e7341750b95b3732ba19e65745edbcb46ee6241 (diff)
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: Anton Vasilyev <vasilyev@ispras.ru> Reviewed-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/qcom/hidma_mgmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/qcom/hidma_mgmt.c b/drivers/dma/qcom/hidma_mgmt.c
index c45e244b2d99..7335e2eb9b72 100644
--- a/drivers/dma/qcom/hidma_mgmt.c
+++ b/drivers/dma/qcom/hidma_mgmt.c
@@ -358,7 +358,7 @@ static int __init hidma_mgmt_of_populate_channels(struct device_node *np)
358 struct platform_device_info pdevinfo; 358 struct platform_device_info pdevinfo;
359 struct of_phandle_args out_irq; 359 struct of_phandle_args out_irq;
360 struct device_node *child; 360 struct device_node *child;
361 struct resource *res; 361 struct resource *res = NULL;
362 const __be32 *cell; 362 const __be32 *cell;
363 int ret = 0, size, i, num; 363 int ret = 0, size, i, num;
364 u64 addr, addr_size; 364 u64 addr, addr_size;