Skip to content

Commit

Permalink
dmaengine: qcom_hidma: fix return value check in hidma_mgmt_of_popula…
Browse files Browse the repository at this point in the history
…te_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>
  • Loading branch information
Wei Yongjun authored and Vinod Koul committed Jul 12, 2016
1 parent d318344 commit 6a2cf55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/dma/qcom/hidma_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ static int __init hidma_mgmt_of_populate_channels(struct device_node *np)
pdevinfo.size_data = 0;
pdevinfo.dma_mask = DMA_BIT_MASK(64);
new_pdev = platform_device_register_full(&pdevinfo);
if (!new_pdev) {
ret = -ENODEV;
if (IS_ERR(new_pdev)) {
ret = PTR_ERR(new_pdev);
goto out;
}
of_dma_configure(&new_pdev->dev, child);
Expand Down

0 comments on commit 6a2cf55

Please sign in to comment.