Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9180134pxu; Mon, 28 Dec 2020 08:34:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2QVHT2GQkShO3CO5VcXrX4RKTq1CDufk200TmLXuG0by+357qxlSArQrP8c5rhkVCQjcm X-Received: by 2002:a50:eb97:: with SMTP id y23mr42951637edr.29.1609173253212; Mon, 28 Dec 2020 08:34:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173253; cv=none; d=google.com; s=arc-20160816; b=L+pfIXNBxpPCFc+aBRxS2rt6COk+L9pSYvcxwbAaZqMxUVgBeHtcEJ7ZlG/nnRBaph E8h3ecodIwTK3b2qMu2c/AcNAAIA5H37hhz3jaQzE9sAAykob+RKer/B5aMwNjyldqqw tOYy17kN2P+82zrWa2A94MxNQOFQlTw/vFv9hAcMWzG5JEYgv0BZ+Don3I/+vrkupKDk fopCEX/Ho3y/2O7VrvejaT5L4yvgdGUUeg6UkdU6dJl7sGFV1Oh0vbHm3VxOpuLOSGig p0meO1PC0moHNMYUk3yjk7rfnr9rrIE3NWqhBgcvXUtNtNyPrJg46ZT/jdvy8wtlXrZu +nHA== 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=aYr9ApwQ3exTJI6WnFMazX3kqtqOEIakZEM+TA02ftU=; b=ofBorkvHY2eRU9WYEbgnQ/YyWCI/Sqgh9yfzpPMDUdwb1NSRuCwouWvJOdfxtT/Fro viUtyoAs7H/oxJBmmQjBzZ9DTy6CaOiZI4ybVbTNNNsb5spEGQwFX+K1psGk1S+U4nYj SspYaqliT6ly3pTez5zwZuOI6LXonFQ5Ku2YvexwvrwiBNRXquRqqiaRyfKLQ+y4ujqJ wgsL3+VSdwEU7cglHErN4e8jwwBmFnh08tDoFh1zPKUBIrknFgTNgy3VIixR85vC1ipU SZLmXyyBclfmf4JNeJhc2pCjj84Hb0sq1J+Ut47hYcPhd8K4jK3NzC1L0IXgoEN94BpH bxqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xzKNLR1V; 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 j26si20441285eds.457.2020.12.28.08.33.50; Mon, 28 Dec 2020 08:34:13 -0800 (PST) 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=xzKNLR1V; 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 S1729714AbgL1NGm (ORCPT + 99 others); Mon, 28 Dec 2020 08:06:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:33888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730997AbgL1NGV (ORCPT ); Mon, 28 Dec 2020 08:06:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5B23E22582; Mon, 28 Dec 2020 13:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160766; bh=aRFtjc0P4kSaBuZtpRKNgR4103VojKbxB7pdrr3GHNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xzKNLR1VuzKx02mt2qpj0Z/anTgTv7dQzwb6XGakk11RSW/XknBz/Swd8K6g4TuDo 8Bqq8MKoLLtH3lMNylz6wePoYDQk4m9pmJSVEoxG1hQHO5rhAknJCiXXfiTZFW3aTJ sWf/iwyR5K3DpmVa2MtFReDRDSQLuLPXtfsftTM4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lukas Wunner , Purna Chandra Mandal , Mark Brown Subject: [PATCH 4.9 164/175] spi: pic32: Dont leak DMA channels in probe error path Date: Mon, 28 Dec 2020 13:50:17 +0100 Message-Id: <20201228124901.185726786@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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: Lukas Wunner commit c575e9113bff5e024d75481613faed5ef9d465b2 upstream. If the calls to devm_request_irq() or devm_spi_register_master() fail on probe of the PIC32 SPI driver, the DMA channels requested by pic32_spi_dma_prep() are erroneously not released. Plug the leak. Fixes: 1bcb9f8ceb67 ("spi: spi-pic32: Add PIC32 SPI master driver") Signed-off-by: Lukas Wunner Cc: # v4.7+ Cc: Purna Chandra Mandal Link: https://lore.kernel.org/r/9624250e3a7aa61274b38219a62375bac1def637.1604874488.git.lukas@wunner.de Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-pic32.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/spi/spi-pic32.c +++ b/drivers/spi/spi-pic32.c @@ -839,6 +839,7 @@ static int pic32_spi_probe(struct platfo return 0; err_bailout: + pic32_spi_dma_unprep(pic32s); clk_disable_unprepare(pic32s->clk); err_master: spi_master_put(master);