Commit fdde18b9 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown

ASoC: amd: acp: Fix return value check in acp_machine_select()

In case of error, platform_device_register_data() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Fixes: e646b51f ("ASoC: amd: acp: Add callback for machine driver on ACP")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211027065228.833825-1-yangyingliang@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f88ee76b
......@@ -81,7 +81,7 @@ int acp_machine_select(struct acp_dev_data *adata)
adata->mach_dev = platform_device_register_data(adata->dev, mach->drv_name,
PLATFORM_DEVID_NONE, mach, size);
if (!adata->mach_dev)
if (IS_ERR(adata->mach_dev))
dev_warn(adata->dev, "Unable to register Machine device\n");
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment