dmaengine: qcom_hidma: avoid freeing an uninitialized pointer
authorAnton Vasilyev <vasilyev@ispras.ru>
Thu, 10 Aug 2017 15:54:25 +0000 (18:54 +0300)
committerVinod Koul <vinod.koul@intel.com>
Mon, 21 Aug 2017 16:21:00 +0000 (21:51 +0530)
commita63efead7f8eeefcf08e4e7d0b033ac552f7da23
treeffa74d8046933d51f107d2d51854549721d5313c
parent8e7341750b95b3732ba19e65745edbcb46ee6241
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>
drivers/dma/qcom/hidma_mgmt.c