]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
dmaengine: qcom_hidma: fix return value check in hidma_mgmt_of_populate_channels()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 6 Jul 2016 12:19:09 +0000 (12:19 +0000)
committerVinod Koul <vinod.koul@intel.com>
Tue, 12 Jul 2016 04:44:41 +0000 (10:14 +0530)
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>
drivers/dma/qcom/hidma_mgmt.c

index c0e365321310009a6df4443b173a9f7823438a4d..6416dededd67938390df091c831dcb30c57aa071 100644 (file)
@@ -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);