[alsa-devel] [PATCH] ASoC: Intel: acpi_probe: fix error return path

Vinod Koul vinod.koul at intel.com
Wed Mar 18 17:01:38 CET 2015


Fix the sst_acpi_probe memory allocation error path by setting right error
code and initiating the cleanup insteadof just returning

Signed-off-by: Vinod Koul <vinod.koul at intel.com>
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
---
 sound/soc/intel/sst/sst_acpi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c
index b782dfdcdbba..b536ddd2517d 100644
--- a/sound/soc/intel/sst/sst_acpi.c
+++ b/sound/soc/intel/sst/sst_acpi.c
@@ -309,7 +309,7 @@ static int sst_acpi_probe(struct platform_device *pdev)
 	ctx->shim_regs64 = devm_kzalloc(ctx->dev, sizeof(*ctx->shim_regs64),
 					GFP_KERNEL);
 	if (!ctx->shim_regs64) {
-		return -ENOMEM;
+		ret = -ENOMEM;
 		goto do_sst_cleanup;
 	}
 
-- 
1.7.9.5



More information about the Alsa-devel mailing list