Skip to content

Commit

Permalink
dmaengine: fsl-edma: fix wrong pointer check in fsl_edma3_attach_pd()
Browse files Browse the repository at this point in the history
[ Upstream commit bffa721 ]

device_link_add() returns NULL pointer not PTR_ERR() when it fails,
so replace the IS_ERR() check with NULL pointer check.

Fixes: 72f5801 ("dmaengine: fsl-edma: integrate v3 support")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20231129090000.841440-1-yangyingliang@huaweicloud.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yang Yingliang authored and gregkh committed Jan 10, 2024
1 parent 7734bb3 commit 4438606
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/dma/fsl-edma-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,8 @@ static int fsl_edma3_attach_pd(struct platform_device *pdev, struct fsl_edma_eng
link = device_link_add(dev, pd_chan, DL_FLAG_STATELESS |
DL_FLAG_PM_RUNTIME |
DL_FLAG_RPM_ACTIVE);
if (IS_ERR(link)) {
dev_err(dev, "Failed to add device_link to %d: %ld\n", i,
PTR_ERR(link));
if (!link) {
dev_err(dev, "Failed to add device_link to %d\n", i);
return -EINVAL;
}

Expand Down

0 comments on commit 4438606

Please sign in to comment.