Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4866164yba; Mon, 13 May 2019 00:45:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJQr31gUT9STrF2bJ2WsTdimgKUNcFGe7W8pAW6DFp9y7lYvXk8kOh1W5qETMFwVzmbjNV X-Received: by 2002:a62:7d10:: with SMTP id y16mr31373894pfc.116.1557733540508; Mon, 13 May 2019 00:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557733540; cv=none; d=google.com; s=arc-20160816; b=y8tahggOK9kl2K+m0zePfMIxWDgmaOy0S8j5ideUYSWyLMGbIiutA6yJttKt7l97Vq c30MjV5wSYeFjAfriWDIXytVaTMWA0De6+q/KO04Qci0w0/2o/CAN5mufq+8zPrXjJEw Js8ShqrCeSmL6xJuYfnfAY4krF9EiJpcKN+OAQgcvtG9Gbu9b0b55UisS9moCiQia83K g6GRe3fCmcIjtQuwyBPiOp2eXaIjuYfx5l9UbxX4/YDVVLPXXC8Y+8XQa0YP0ZukkMcy k4RgP/cW0TbQzeYc3IaUAXntfsmaCPmbko5LvLxwZn9EukQpV98lFo2AX0cGFnYziTcx ULtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GBhPlNIbDGED2JFOTjRFPtfulBnVvGhW+6QPJZrM2jo=; b=h7WP95J9ChfeID57HGQ1Ip5LKdJVFXjMwQ7I8fwsCtyW7EAL+rDG8L+N3uYsUMXEkN 2fT0a10Sa/72S3gUDidYwrIxWAYrSx+2+wzRD72FykJzbmE6dYT1YN7hnyJBfts+c02u Wz0YX28m5GxBrju0PGwXqkEn7KJABjLwajdxhSHFcLDCOYYBFdEv7cR/pr/JZs6VyNh9 2P4p+aQpjQHF/asJZp2GHNlNi1vZvuRJkSvnBQSEg43DG/Fa2NRI3xkSyuLx9aY/K8/+ DPIlE32TiIjT+TBunOxEZcjiI7gVd1FgXkI/wlVpOJv4GNOdlVOZKOkoV08ScE0t+FrC lUqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZJEwu0+r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si15588036pfr.229.2019.05.13.00.45.24; Mon, 13 May 2019 00:45:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZJEwu0+r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727930AbfEMHOz (ORCPT + 99 others); Mon, 13 May 2019 03:14:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:34416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727568AbfEMHOz (ORCPT ); Mon, 13 May 2019 03:14:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 464F820578; Mon, 13 May 2019 07:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557731694; bh=0vjm7BJSAo+A2YxcnfzZfoWM4WgRO7sXAA6JkaduZuA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZJEwu0+rMPfOroLHfuKpLy6OEqzgxhviAsu/PambX+89fgLAEd5NLSIpPFndrBt4e RoGlSIre7yR+cOD3UhXSK94qHFCWhh+7WM8gvSAF9XwqL+AvZbOCzSl8hiDIgOeUha KJFZ4RNTw1j8eo4Z2P3gVSjR/A0A8bkrv83c7vHw= Date: Mon, 13 May 2019 09:14:52 +0200 From: Greg Kroah-Hartman To: "Tobin C. Harding" Cc: Mark Fasheh , Joel Becker , "Rafael J. Wysocki" , ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ocfs2: Fix error path kobject memory leak Message-ID: <20190513071452.GG2868@kroah.com> References: <20190513033458.2824-1-tobin@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190513033458.2824-1-tobin@kernel.org> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 13, 2019 at 01:34:58PM +1000, Tobin C. Harding wrote: > If a call to kobject_init_and_add() fails we should call kobject_put() > otherwise we leak memory. > > Add call to kobject_put() in the error path of call to > kobject_init_and_add(). Please note, this has the side effect that > the release method is called if kobject_init_and_add() fails. > > Signed-off-by: Tobin C. Harding > --- Reviewed-by: Greg Kroah-Hartman