Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2660837pxj; Mon, 31 May 2021 07:39:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxR773GBjD0iHvrnKuxcMtdi+Dwe0TJsVYPzZgqaS0hs8dAxP7yVlbQDd9yg6KdHxzGB5E X-Received: by 2002:a02:caa9:: with SMTP id e9mr20474152jap.87.1622471968052; Mon, 31 May 2021 07:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471968; cv=none; d=google.com; s=arc-20160816; b=qcgJV/1v6xDascWOC2Xr6ngUSkSYh5z/c4eCpi0wXx3dluLO79F4708MteBHezv5pr ZQQInS+7OBa0HPwxnOdcYCicRA70+3gWbMnQOjG2mq8CGtbdWDSZ6a+y2Dp8iaiJhe8Z GdZttPYqjbrobp/3K6aMNrKms52C14tlJude6Y5VKyV86WLILbTlFGCvW/YG9ox5wfgg 9wwFcePHXlo82LJVIseVbwb5NIbxe0SZQQDfLx7pHIPaNItpYSs7l1WS4GAXTKAKWXLJ pOOtlvBxR5TLRRddlDr88t7pI3K/RWDWprqTtPB1fZuDQRqnSR+8YZpmyM4rGA+Dc30j FSoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9gSvzvzPKM1KYO32TA/S4ySIioFQU0+O961M790strY=; b=vcxy4pUotwOqRqEF9PmOw0L/kulLvSL4jfaduC3U265ITllcxfXjguGc2/wYT+xF9Y hHci3ckNIOwuIIraFGl/0P0hrurxPsVzytSj/gjUhVmFbGNT7ZMiR4iH3ZxB0TqRAgOV QrKJ/+HMYEANSKDELf9f0WLPRUVJRFfhirHkbOoSTNdHstaB0SnoxUSffrztU/KZg7EY TFepigDYYKrcbQykAUzLUqwEEWZiduVXjOZPRRkNZddbplie6xk+ktAbVizG18fCOAB7 maBvXM/sSl4LuxGqBYAWEYs6ZI6mgiKPomUl9RauE2NuSPnUyiOCfL06KXtFqKIQdMwG 4TPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y2jY3V41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w31si13907423jal.77.2021.05.31.07.39.15; Mon, 31 May 2021 07:39:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y2jY3V41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232197AbhEaOip (ORCPT + 99 others); Mon, 31 May 2021 10:38:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232732AbhEaN4u (ORCPT ); Mon, 31 May 2021 09:56:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9CD87613F3; Mon, 31 May 2021 13:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468087; bh=d5hGgpFXl/WfnpQuNaib7PPQjw6cDvtuUJzj/dDkc3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2jY3V41q6TGQHc/RyUHVshVt1yXjSx+BmLNFr0lpXhe1lSk5Z+8j0ZG8gChzK1Ti thATdknMEgAEg7TqlTzLcwPWMJQ7aJVSobeyrEtZOYEb1PQhwVlRzVBrL1cmmmLUkL 92eLxPjzKQgx3Z4ExAEFtLf8zq3CRGXJFPCtbjbg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Vladimir Oltean , Mark Brown Subject: [PATCH 5.10 110/252] spi: spi-fsl-dspi: Fix a resource leak in an error handling path Date: Mon, 31 May 2021 15:12:55 +0200 Message-Id: <20210531130701.717075542@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET commit 680ec0549a055eb464dce6ffb4bfb736ef87236e upstream. 'dspi_request_dma()' should be undone by a 'dspi_release_dma()' call in the error handling path of the probe function, as already done in the remove function Fixes: 90ba37033cb9 ("spi: spi-fsl-dspi: Add DMA support for Vybrid") Signed-off-by: Christophe JAILLET Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/d51caaac747277a1099ba8dea07acd85435b857e.1620587472.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-fsl-dspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1375,11 +1375,13 @@ poll_mode: ret = spi_register_controller(ctlr); if (ret != 0) { dev_err(&pdev->dev, "Problem registering DSPI ctlr\n"); - goto out_free_irq; + goto out_release_dma; } return ret; +out_release_dma: + dspi_release_dma(dspi); out_free_irq: if (dspi->irq) free_irq(dspi->irq, dspi);