Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2134701pxb; Sun, 17 Oct 2021 06:46:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymho5Uvi6/i5nVfmweMEvbAxYNjoWQAUJfA1rtgRPJZ9CB4tHwUDVFU+yTHd1zAu+tK8DH X-Received: by 2002:a17:902:6bc3:b0:13f:8e99:ce74 with SMTP id m3-20020a1709026bc300b0013f8e99ce74mr15200811plt.29.1634478377135; Sun, 17 Oct 2021 06:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634478377; cv=none; d=google.com; s=arc-20160816; b=OcEv37UhCUNPS9QoXdG1J1+6ZSpnuXrmjJSjH1C6ewCn0h5UYbAMUEibtri/C4FE9s 8XsHvWkfHfNpFuJygd//8ZTKPBvFHu/V+EDo9c02y5kW6KUyVbWf2J+QlpQqKTiM6Mj7 bQXUgu0EN9AwBHW/kckWJvbUNkMfR+0IvGDhF2clFHCchOO4TxuLwIBI8Gb+wm4nPpS1 5NYUDkmOeCnTla0zClMJB2otqBZ/n+05PraJRdF9L1TDmr47x527JWhUnGrXoKo63EN4 FnwheSznSZyVzDGG2W0c0XDat1s7CsiiEesMQcY+YGcv+Olr543KqJGi5ZHTp+PFrroc UbDw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rzyEN2IKemEthFw0BhV4JmnKiL6LJx2wO9/bgd19Ox4=; b=E3OVIhxF5NA4kPuDn5SSQsv38nM5mpvVVyfyQqNB7DCSq8prSFzN/l4Y0r/YixpR2o FAijWeWATtsOk22k4I1jgn/KXYANkUdWectDe+qWa3a0x/ORHT8GPVZdHrrXozDrf1kv u32px59AvCb13cWcforRvee87OE9AeK/cCeQI9PsL2AsEdMf2SRnUAch6ouGzmCIYAdO 71EVb4yejvP4UhTSGdlNPeH4wJF/5nG2+t1DLy8V3r/0IOgccK67yFDP8YBoE7jaLLsY Cv+P30NFYgiDeZEDsxbRYUS2TAINPxKPRkbJFz7t2L6VCSoIKIxxvTHGTdi+/xqk5Gef xGYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M493+FP1; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si17147540plz.193.2021.10.17.06.46.04; Sun, 17 Oct 2021 06:46:17 -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=@linaro.org header.s=google header.b=M493+FP1; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242338AbhJORZY (ORCPT + 99 others); Fri, 15 Oct 2021 13:25:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242341AbhJORZA (ORCPT ); Fri, 15 Oct 2021 13:25:00 -0400 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33786C061780 for ; Fri, 15 Oct 2021 10:22:24 -0700 (PDT) Received: by mail-oi1-x22c.google.com with SMTP id t4so14016868oie.5 for ; Fri, 15 Oct 2021 10:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rzyEN2IKemEthFw0BhV4JmnKiL6LJx2wO9/bgd19Ox4=; b=M493+FP1Xy2KglJSyE0b3mrxkEeDorK3QcDt8nbhgmASBjTYSH4ElUGss0AaxmLdMq aSKRC1MxYuiOngTyM0o5zjs2fo2XVFAZOiAWWDwv3q+7niV1iOiuN+09r2k8gT0PMPHc kHieRShGPo6MA1/AFtYVnU++oaorAI6NIM2g4vgO8rXi4eRGZai8dCQUc9qTmGoWwni9 AVOYtv1HR/iRoJ8U7aBmfidQA9VrCZzK7ANKrXdUmkmR8ZGMELU24+TuevtMOIJ5U9hF /JmSeOAYjgiX/OdNaqVNbnAYZxqRouj1kqYtcGYG9rdKdds88ya69iuNg5VFh3jCxHaA Dggw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rzyEN2IKemEthFw0BhV4JmnKiL6LJx2wO9/bgd19Ox4=; b=HBThnVcSZnAqQ//txGg0IgDPV4LlWLr8PSRQlleRAqU7LPKFPD2xzJOPm+FZT+78FY RrHxFCwwIHxRvyZdv3ijKC896bR0toAPZTCBBn4ih0+Kdb5NOmv20CI/lwOa31bMWndo FiuJdCDU0Imt0+Q7JqX/fH92eXh+bygygMgBsFTsF8tHsWx5giBEdtzLwzLuuBWkQQv4 b4/EVfpX+acTkqae1hkq4WJdPbnIkCvdS1vsfLjHAEC3W4XKnBbtf7VgOvzl+dI0A3AO KZl7aiKSrqDay2GMIukq92C41r5X8U3zKFnCj1UJrUuM3V2VZ+ihl+PbR8nYGg7vjJ2y SNbQ== X-Gm-Message-State: AOAM533RtXyEMhKkaRYl2dXCF5SWiPPyYkSwqLqsppnyqn+QJRCgN34Q En7gLoO34WErRQs2qB5TZ/U6gQ== X-Received: by 2002:aca:bd02:: with SMTP id n2mr18572809oif.113.1634318543564; Fri, 15 Oct 2021 10:22:23 -0700 (PDT) Received: from builder.lan ([2600:1700:a0:3dc8:3697:f6ff:fe85:aac9]) by smtp.gmail.com with ESMTPSA id s206sm1289635oia.33.2021.10.15.10.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 10:22:23 -0700 (PDT) From: Bjorn Andersson To: mathieu.poirier@linaro.org, james.quinlan@broadcom.com, Christophe JAILLET , ohad@wizery.com Cc: kernel-janitors@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: (subset) [PATCH] remoteproc: Fix a memory leak in an error handling path in 'rproc_handle_vdev()' Date: Fri, 15 Oct 2021 12:22:13 -0500 Message-Id: <163431847249.251657.11309404044031278395.b4-ty@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: 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 On Sat, 4 Sep 2021 13:37:32 +0200, Christophe JAILLET wrote: > If 'copy_dma_range_map() fails, the memory allocated for 'rvdev' will leak. > Move the 'copy_dma_range_map()' call after the device registration so > that 'rproc_rvdev_release()' can be called to free some resources. > > Also, branch to the error handling path if 'copy_dma_range_map()' instead > of a direct return to avoid some other leaks. > > [...] Applied, thanks! [1/1] remoteproc: Fix a memory leak in an error handling path in 'rproc_handle_vdev()' commit: 0374a4ea7269645c46c3eb288526ea072fa19e79 Best regards, -- Bjorn Andersson