Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9096491pxu; Mon, 28 Dec 2020 06:33:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJ7eKlI82r0XvvuHGBGcOYKlbZG5OcihsBPgmTzMBwCfG9W4h5eEOMAgFaLYiAKiIbHKB5 X-Received: by 2002:a17:907:3e85:: with SMTP id hs5mr42933650ejc.548.1609165987193; Mon, 28 Dec 2020 06:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165987; cv=none; d=google.com; s=arc-20160816; b=DmoWMaaQXJWOik/G7TFPSjDwVq5DUqB7Wp0pTrY9z4mYxzqJV4YQkPurlLfoeEmzwn mAinPvckFFbbPYFylEzP6xvHUzIHN2tFk7TxRdoft+mBcDUT4HqjjCKC37L0qIPs7Zzm mm0K2myNgAJF5GM3bUAxhHp4I3f88ej+vxpxAdJabTLZm93cwnxkMtacpDQOdRtk4mxA cZAcn3m9BwAbIDcaKHvBpphy3X/Cwa0GVNQq107aYeV+TZuZhJR5La+RfLXRkSlcTFT8 GTU+5RGc2ZJuvN4AuFxZtY1OlViKwFoUA0ZMBdQTeZV+po4botOjAM447RXurtq/TFJW Hmlw== 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=PcGo6oW/bYlYkY6+aW3LBTVinrdcwMdMN7IgfvxbI/zZiipaIJ03rAvMxEl4kE+5q+ hhJKlVaLEUueHmkMpkNKBz+QIlgt5clYUxKv5h5U5cEAdIho+nqFw3JAQNK+YhM7tX09 CRnSQXIuRGmfTtQndqV53IXi9PbHWyJg1zntczAsDU4tB7iflQgoB4mt/B03dYNEbYLD lLaaJG/PXZew3Rrc0dfwpDq25B3hGYw8K43+dzTOOOZlK26XGiN+tW97Okgt9KGc1Fvd GqaR2+E8hrbkBUJYj42JuzeoqDrOMTG6vF8eHUK24FoQaVBH/DgiNOcJp8P4y27g+Iug Z7gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tywOR+ch; 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 a12si21338827edk.285.2020.12.28.06.32.45; Mon, 28 Dec 2020 06:33:07 -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=tywOR+ch; 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 S2503661AbgL1OaX (ORCPT + 99 others); Mon, 28 Dec 2020 09:30:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:38366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503622AbgL1OaQ (ORCPT ); Mon, 28 Dec 2020 09:30:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A0B21208B6; Mon, 28 Dec 2020 14:29:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165776; bh=aRFtjc0P4kSaBuZtpRKNgR4103VojKbxB7pdrr3GHNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tywOR+chD0lccbDOr/KCh/RjZzriZm19/z4KUDxD64zQzWereT3iqSfBNYwoyDO5N sJ4bWoRbjOOado/l5hUPvBf2N/7+E8q1irF/SlRwQdPzO6phwD/qGmK48ItYHcC/bc VCAqUEIbZMPk5/vs/z9Bwqg/w0Kq0CKNI69T1Ncs= 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 5.10 651/717] spi: pic32: Dont leak DMA channels in probe error path Date: Mon, 28 Dec 2020 13:50:49 +0100 Message-Id: <20201228125052.139403635@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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);