From patchwork Mon May 10 12:41:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12247907 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A43C9C433B4 for ; Mon, 10 May 2021 12:44:14 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 36B70611C9 for ; Mon, 10 May 2021 12:44:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36B70611C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AqYERthfuBcMB4wh2HNbataaX3frqouVuBaIS6+qyB0=; b=rJO7i+1wiAW7UWwUCTBwx78sX IE6rllgciCU/299uw5TP1HDAe9YkCWlme0XFrZ3mRJ1uLMj3yBxWzvotD8JwqfJ3f/Dp3QKbqfrWk Rwba7w/gV+GAUwdvTVfik+aeG15xq3nHnhm/hDgrxsZb1XVh84ebcM2Cg7D7NWM4QMFU6rDw6jQWZ EtObG3lRop/2AlOl33Q+0uIfQIqIhdq+E+/sPYQXha8Af8z4dyGnARH0vJhTmh30DQZnzOL3Dqb8n 9/+kk4xv/mdZnBqcev6AF2y+NCVLXiZSUNeJbOMIVLnR9NrH5p/latEwrJkV8evJei2S2P5b7MKdA paOBOczNQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lg5Ef-00EIYN-Kd; Mon, 10 May 2021 12:42:09 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg5Dx-00EIRP-Re for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 12:41:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ntO3cDF6BTLhAwP4kajE4r5z5ChBmuMwF5JrBz1K2x8=; b=S9klrXnv8kxrHTwg5AvBAOroC5 CG07TM2Lg/NV3HbxufA2FDSttlCLH56Du/P4esnF27+87tdVyw9K2N5SWUl6xAjTgy+E8yYmQFJOO x4IhKF7aeea1FgCbCvnyS/McckHnOAVGU8bYGd5Q98vEa0KP8ruJCOzCq5yEOkiPhXjManSl8K6Fr MH9z2M6q+prZiSj7Rmb8/NBGal6SdnA7sKcbZyGje5EJz+U4crZG/T7E+wTCXw1WMEOwRyvXrpB0x wCfrtK6KDVaFmgdgqCuqyBFZXvepey5kJNgOByOd7knw/o/8OGjgfP9hfem/XIGKsxEJoiZxF55kv h6BhnEBg==; Received: from mga12.intel.com ([192.55.52.136]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg5Du-008hQD-SU for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 12:41:24 +0000 IronPort-SDR: XAKMf+dY75JRIP6xG5kyEO2z2iNs9UTihaCl+XvHLc9oeUdQ6BTJaMeZEU7SYJR41sdXi6UNbI txoYIWEvlF3A== X-IronPort-AV: E=McAfee;i="6200,9189,9979"; a="178772950" X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="178772950" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 05:41:20 -0700 IronPort-SDR: h95c03LnyjhF35XWAmszvclXci7XINUy4g0BVV+RzhYcbtawsg/8m8rESXvy5xDMt7ZdJ3lMyy 3dGlZCsDRRxw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="429898265" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 10 May 2021 05:41:16 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4161EBA; Mon, 10 May 2021 15:41:37 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai Subject: [PATCH v3 01/14] spi: pxa2xx: Use one point of return when ->probe() fails Date: Mon, 10 May 2021 15:41:21 +0300 Message-Id: <20210510124134.24638-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510124134.24638-1-andriy.shevchenko@linux.intel.com> References: <20210510124134.24638-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_054122_948969_70AE388A X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When we can't allocate SPI controller, jump to the error path rather than return locally. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 5e59ba075bc7..2f5618883ac3 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1705,8 +1705,8 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) if (!controller) { dev_err(&pdev->dev, "cannot alloc spi_controller\n"); - pxa_ssp_free(ssp); - return -ENOMEM; + status = -ENOMEM; + goto out_error_controller_alloc; } drv_data = spi_controller_get_devdata(controller); drv_data->controller = controller;