Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2675280pxb; Mon, 11 Jan 2021 16:52:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxB/NuHNqMheqoSANFk6PBONIRWzXfNRqAP93elQieEv3tPAN583D/fcFLGFxwnLHb0niPp X-Received: by 2002:aa7:dc0d:: with SMTP id b13mr1426314edu.170.1610412751624; Mon, 11 Jan 2021 16:52:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610412751; cv=none; d=google.com; s=arc-20160816; b=fzGA3GyIvnZW2VK0Hz2zeMzSrocgmcwWE8nakj422VI3tagQ09iq2RAwndvL562It/ R6zIIPC7m7ndvaXya/UAHhatVwH87olVBOF4yS/+OCBQi8tCJbMhP3e6QhTza6LuTogU qJEflQjxFLi/Q6MoNErZJbVa2hwry/nT20DblardnTQCH9FAIQZuf7YIA+BUP5BMWxcZ +CJs0iiVj2uv8I0uGw/ywoTRF5WFCfJggKtzX+H8Tqni7gfc79LpA1V61+oEipeMkTAw 3AJu+naoiESO7gNaPIsFNuZXSf3uzFVDQlzRR9T6JozBFTeMhIXf/ID+eIJvygqQASe1 s8Qw== 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=2f3YqM5+o7najb6dmUk/vnjtGdYYVSxT2yv0XSWBshg=; b=SATUPJ38eVUlgCv5KGC47NhB7KeVZu4pcPoeQG7KCrFTQa7OsxmgBut78Pn/HqPVvP OWFSy8Wfge+KTvSTmAznaRgp2hM5vQCgjdraGDa4PRCz15xhhhgLQJeNAq/8cET5h7gY qtVwEqWKOVuiEjsS034+MuUJz5//J2Bgul2JWMmeHf1fsjTjEfLC+mlTRqEsKg8KESpi v7S/scYtGGT9UKdMLdfssWVjlC/DlUT1wlN/6lFGcVItEVSetUyRZdWWGNjlU4f982mw gxjx10eYbQ0YNIfFBqYRqu/23iIaCtSirFWL2qGf95XikZPS5vJlyx0at9DAUDhCWQDm XOQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E4fglSwL; 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 k18si572172eds.42.2021.01.11.16.52.07; Mon, 11 Jan 2021 16:52:31 -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=E4fglSwL; 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 S1731520AbhAKNMq (ORCPT + 99 others); Mon, 11 Jan 2021 08:12:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:59190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730855AbhAKNME (ORCPT ); Mon, 11 Jan 2021 08:12:04 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 196F92225E; Mon, 11 Jan 2021 13:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370683; bh=G0noWMFnPx4Xa1LAOaU73xoY/TmIC6lqcfmQq+kqoDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E4fglSwLjmVeWv1JRBbdlzJTy5D/CZyxsCqTsH5e9p3ccddO8w7ZUNYhFqUD8u3qC 4YnkgOjxeS+8I9HAg+0tVB/hNMR6Z4XyO/omkvwgdQi+tP9fQBYJufR0JtADv/p2So cuKc3/dX5IrDK0OSL6ruZhqjeNZdpwfZsfAnbLLE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET Subject: [PATCH 5.4 52/92] staging: mt7621-dma: Fix a resource leak in an error handling path Date: Mon, 11 Jan 2021 14:01:56 +0100 Message-Id: <20210111130041.647963147@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130039.165470698@linuxfoundation.org> References: <20210111130039.165470698@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 d887d6104adeb94d1b926936ea21f07367f0ff9f upstream. If an error occurs after calling 'mtk_hsdma_init()', it must be undone by a corresponding call to 'mtk_hsdma_uninit()' as already done in the remove function. Fixes: 0853c7a53eb3 ("staging: mt7621-dma: ralink: add rt2880 dma engine") Signed-off-by: Christophe JAILLET Cc: stable Link: https://lore.kernel.org/r/20201213153513.138723-1-christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/mt7621-dma/mtk-hsdma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/staging/mt7621-dma/mtk-hsdma.c +++ b/drivers/staging/mt7621-dma/mtk-hsdma.c @@ -714,7 +714,7 @@ static int mtk_hsdma_probe(struct platfo ret = dma_async_device_register(dd); if (ret) { dev_err(&pdev->dev, "failed to register dma device\n"); - return ret; + goto err_uninit_hsdma; } ret = of_dma_controller_register(pdev->dev.of_node, @@ -730,6 +730,8 @@ static int mtk_hsdma_probe(struct platfo err_unregister: dma_async_device_unregister(dd); +err_uninit_hsdma: + mtk_hsdma_uninit(hsdma); return ret; }