Skip to contentSkip to conversation

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

PATCH In review Yang Yingliang 2 participants 2 messages Oct 27, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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().

Fixes e646b51f5dd5 ("ASoC: amd: acp: Add callback for machine driver on ACP")
---
 sound/soc/amd/acp/acp-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/acp/acp-platform.c +1 -1
index 75003d0a41e3..65a809e2c29f 100644
@@ -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;
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 5 lines · Yang Yingliang

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().

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: amd: acp: Fix return value check in acp_machine_select()

      commit: fdde18b9773636cc5866ccd8f2093e1cf0022dea

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark