Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2811755pxj; Mon, 31 May 2021 11:23:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkjvlI1t4h9SNo6H9+62UjivaPe8eSfwNynMljTra+7/DVFo/ZXqcQZjFMdSHnStEdmrkv X-Received: by 2002:aa7:dd81:: with SMTP id g1mr3849344edv.274.1622485390041; Mon, 31 May 2021 11:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622485390; cv=none; d=google.com; s=arc-20160816; b=mKbEieA4i1UbB0bnzHCb+cAWxrvbGf+/403yJmGPnkGWk4RTbq6XhutKWAKVDVOKT5 yWCLj+DpJnYMG7CwtQKK6gLVNixbGc+RSJi0ngz+rRF1B1OZrLJ7GEXBTlOGjFdc958b qog5li3E02idqGXhKIG6wtv727wuFP4N2gPDZ/chd1xlgpYXwM4kC9KipPnZ0CXtFly9 MBYRfCfGJ32/Nn3qWwwGPDrQPqkQCuxNEOARzLGPXFW7TUF2cyo2omFb3uRhnBCkc9/9 RcgKnJKCZHivyUMt0BcqoMxk1Yxdd6P+CBqLHii4RalrjiU3YczA+d7r+yz2okis89lq qfIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8OI4Ivk/me8BDPwhGAAe+tVQyzgxbbtNoXzaG5n5waY=; b=g5+ZCFnQPYMq9c2mjQcg9Np2UGdAf6m0vGyTZyCenpAFYq/eHbCDrufwnBsPQu280E bJZel/ltJE+sWbgsA6HE6o/3WjwibJLzwGpWqU9n0n5VvDBFLJjvOa3beM3+L65lMN9n Vutb85ewUVIn0MLfnIyAKkWHx55cVTG301bjKcgZtjrH5GbHCPCcXo7ykdTo37Mh3W7b Pc4ZC50kecqZNw+RHK7g0U5i5N8bDb5LKkrnb/ufGB7JSrboI3K7GxyoqgYPyccbIO0X XSbf9dGdh9nGlYd9wcXvUol9UAyS97VE0oxvm6pj03UcLJIW125nndGnq/0h4+Ol1WGE s9Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I9BUxpgl; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j25si13853146edr.84.2021.05.31.11.22.47; Mon, 31 May 2021 11:23:10 -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=@kernel.org header.s=k20201202 header.b=I9BUxpgl; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232043AbhEaSWJ (ORCPT + 99 others); Mon, 31 May 2021 14:22:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:52330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231673AbhEaSWG (ORCPT ); Mon, 31 May 2021 14:22:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4E90561263; Mon, 31 May 2021 18:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622485225; bh=KVPxsK67S4DEMtK/llxKJ6tK1HvNLCXUFY8DJOuS6nE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I9BUxpglvR6MP91AsSBt9W3b34G3moZnd/t+dcVjBIo11yUfcSAue4Ibfcsc0x+vc eIbs2np8fXwvdHDajUcEX6trMA0BepkWUZ7Nrd8fM03m4c4eEg11K487NAxsgI8wDf tyMJyxPvEXuKU4CO751CS6DAq/uM18Tr2FuJ4QAbJkD+GL5457Jojga0IdOwB5Paie CaAPHUQEN5+gENAHAmAflQlV/3xGnIyXt/jyXAV4hVgTNI/mWADjufjmzIiHySmzQ9 zTY2Vx+rSedXmYGTx2FjEck6zy/9Bf3+ytS90HYcyyrlJKrtjd39grpZDZZEZbV8dT aa0hJfTcKGvMQ== Date: Mon, 31 May 2021 11:20:24 -0700 From: Nathan Chancellor To: Jarmo Tiitto Cc: samitolvanen@google.com, wcw@google.com, ndesaulniers@google.com, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH 5/6] pgo: modules Fixup memory leak. Message-ID: References: <20210528201107.459362-1-jarmo.tiitto@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210528201107.459362-1-jarmo.tiitto@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2021 at 11:11:07PM +0300, Jarmo Tiitto wrote: > Signed-off-by: Jarmo Tiitto Similar comment to 6/6, squash this into 3/6. > --- > kernel/pgo/fs_mod.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/pgo/fs_mod.c b/kernel/pgo/fs_mod.c > index 0808d44227f1..2d1ff99e7982 100644 > --- a/kernel/pgo/fs_mod.c > +++ b/kernel/pgo/fs_mod.c > @@ -261,6 +261,8 @@ static int prf_module_open(struct inode *inode, struct file *file) > > if (!pinfo->buffer) { > err = -ENOMEM; > + kfree(pinfo); > + module_put(mod); > goto out; > } > } > @@ -373,7 +375,7 @@ static int pgo_module_notifier(struct notifier_block *nb, unsigned long event, > if (strcmp(data->mod->name, mod->name) == 0) { > > mutex_lock(&prf_mod_lock); > - /* remofe from profiled modules */ > + /* remove from profiled modules */ > list_del_rcu(&data->link); > /* mark it stale */ > WRITE_ONCE(data->mod, NULL); > -- > 2.31.1