Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9169188pxu; Mon, 28 Dec 2020 08:17:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZ0NkxZZqrXqDacwrPhngPMp/ng3ooFl4R2YH68tQrr0H2CJQY2DFZ8O0DmVsdA0IaMTaG X-Received: by 2002:a17:906:3711:: with SMTP id d17mr41695902ejc.121.1609172254339; Mon, 28 Dec 2020 08:17:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172254; cv=none; d=google.com; s=arc-20160816; b=BzFUtPcPI3M43YVvE8cK38lYUfaSuA1Dppl3JCyoLPQHdi7TXs99CTe1Ei5bmGpKxr 50/QgDQpzRDpaWXe9qVyTrQC6StB082BJShix9Nw/WVDnj45P/YAWwuna4aFHw69sQ9X sCOJaE1YtMhoSDbNJWEI10J0xX4uCKV6T0B1kT4UpCjuDHVocJK+3hYlqcDES8N3qO6u TczAjN5Mmn8W8zh+BpetIk0NZr49t7yQ3HtFJQeg+zWukWXaUNgEkCVMIsY8eACGlPcF slg1gWaaJbAsUDtnY6vyJMRgCZdgDAOMpyRQUP3UJ/mqxBsn/v7DDypBYPXdvFxybahX snfw== 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=M5BcIbavg8uR2WKX+C8zNk6L+IccCkpw1srbYLRuMW5aVso6PIstcWVbPBdbHnDNHh 8UD/mAZTi4v8GQC3TbPLgWjbTKrvGHbS+f/FF9U7kcT/hCOC9qvTN3QjVk6bfW9O36hv O2sfKvPi/r3YoIjJiIVuswwbwvDHU2P/a3mm3KTHwHOgLUwqvQumHMso7aJbSxc39ERn dZx1KC0LeBd2q8Cg9SrzTJoBb0hZRu0TkWWrdhR/w40TRCSM2ktpzClflDHmqBakSziV a5OybkRFjjvs8Ty1l65ssWBbllgR8jfd1u53bJ9gVs5h0N7kcTT2DefDR1grfgGDy27W lNDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Pd7CtB07; 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 h19si18097911ejf.742.2020.12.28.08.17.11; Mon, 28 Dec 2020 08:17:34 -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=Pd7CtB07; 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 S2387513AbgL1NS3 (ORCPT + 99 others); Mon, 28 Dec 2020 08:18:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:47042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387506AbgL1NS1 (ORCPT ); Mon, 28 Dec 2020 08:18:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5B1C022AAA; Mon, 28 Dec 2020 13:17:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161467; bh=aRFtjc0P4kSaBuZtpRKNgR4103VojKbxB7pdrr3GHNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pd7CtB07ncRrawBI39k44r7Qz21kzmvcVjf9YiSZlcuQEF2bKMVLxx9eMrTSg2u6T 4d62QzWTPb0XmPhdPdXqzvz0JAX94B3JaEaVEawgBEe1mwHW8p3lY2I7n9iQ17o2js hSgtAwvgM8cHrWpjNV7+OYI6vGYjFl9lDNmp4J80= 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.14 222/242] spi: pic32: Dont leak DMA channels in probe error path Date: Mon, 28 Dec 2020 13:50:27 +0100 Message-Id: <20201228124915.597792510@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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);