From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752404AbcHJSEH (ORCPT ); Wed, 10 Aug 2016 14:04:07 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34312 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbcHJSEF (ORCPT ); Wed, 10 Aug 2016 14:04:05 -0400 From: Wei Yongjun To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, maxime.ripard@free-electrons.com, wens@csie.org, kuninori.morimoto.gx@renesas.com, emilio@elopez.com.ar, hdegoede@redhat.com, ats@offog.org, fengguang.wu@intel.com Cc: Wei Yongjun , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH -next] ASoC: sun4i-codec: Fix error return code in sun4i_codec_probe() Date: Wed, 10 Aug 2016 13:42:34 +0000 Message-Id: <1470836554-11569-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix to return error code -ENOMEM instead of 0 when create card failed, as done elsewhere in this function. Fixes: 45fb6b6f2aa3 ("ASoC: sunxi: add support for the on-chip codec on early Allwinner SoCs") Signed-off-by: Wei Yongjun --- sound/soc/sunxi/sun4i-codec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 0e19c50..e741659 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -846,6 +846,7 @@ static int sun4i_codec_probe(struct platform_device *pdev) card = sun4i_codec_create_card(&pdev->dev); if (!card) { dev_err(&pdev->dev, "Failed to create our card\n"); + ret = -ENOMEM; goto err_unregister_codec; }