aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2016-07-06 08:19:09 -0400
committerVinod Koul <vinod.koul@intel.com>2016-07-12 00:44:41 -0400
commit6a2cf55db33d13474b7c339d3e4cef8993508a40 (patch)
tree2f833a2c15602fd237e646741f0a79548c10f047
parentd3183447ef561efe7e734cb4bc331519c276a786 (diff)
dmaengine: qcom_hidma: fix return value check in hidma_mgmt_of_populate_channels()
In case of error, the function platform_device_register_full() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/qcom/hidma_mgmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/qcom/hidma_mgmt.c b/drivers/dma/qcom/hidma_mgmt.c
index c0e365321310..6416dededd67 100644
--- a/drivers/dma/qcom/hidma_mgmt.c
+++ b/drivers/dma/qcom/hidma_mgmt.c
@@ -371,8 +371,8 @@ static int __init hidma_mgmt_of_populate_channels(struct device_node *np)
371 pdevinfo.size_data = 0; 371 pdevinfo.size_data = 0;
372 pdevinfo.dma_mask = DMA_BIT_MASK(64); 372 pdevinfo.dma_mask = DMA_BIT_MASK(64);
373 new_pdev = platform_device_register_full(&pdevinfo); 373 new_pdev = platform_device_register_full(&pdevinfo);
374 if (!new_pdev) { 374 if (IS_ERR(new_pdev)) {
375 ret = -ENODEV; 375 ret = PTR_ERR(new_pdev);
376 goto out; 376 goto out;
377 } 377 }
378 of_dma_configure(&new_pdev->dev, child); 378 of_dma_configure(&new_pdev->dev, child);