Received: by 10.213.65.68 with SMTP id h4csp1718036imn; Mon, 19 Mar 2018 11:19:51 -0700 (PDT) X-Google-Smtp-Source: AG47ELuh8GTcG9LZh6rVsPAN1eRqUeZkyU/lp4gQGwejcHzUVIqzocd9+MVzSv18JmhenocFm2yM X-Received: by 10.99.110.129 with SMTP id j123mr998608pgc.65.1521483591746; Mon, 19 Mar 2018 11:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483591; cv=none; d=google.com; s=arc-20160816; b=ZoM1U9ajlFz+rjC6kcP0IKw7aOfh+6Otio8MRjAhTJzXywtVxjViHS219e2Sg2FZni bRB2oW7sJL/h0uLoJup08oX5UcvY6jvXYGZlXhBjwyfU3guKsiC0h3aH6xxhGEdExNSE b07s6DMbUs0lbuA1shJN7b/WtYvcLt8XEnp0wUVOuQr1cQ6d7zjddWlvy2TNbHqyyQ/v swfHth8pYaf9sFe0Io4S/c5jZJqvVTWMwvh12FcuU80V++XHwW68UgpiU8720dAINQlD df5L7jAy6DVjO7fb4VgMWUizU/t32wavxyDF5IUCaEKA4rmDz/GvheIcHnHv8cJNboZO +WFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ibo9FSzP0zjriPpuw766kePLVMawMBjIIIA1hCnfRJo=; b=gUuIhBB+KmYtiFuWa6O/tFpqhmSUmFzQAK2ASaAB5ACdnrKCusXRepThk7N3hHHuFy 6legXRnsBVyMVtTLF07GuiCBQ3qV1+2YsJnGbehvind3g/8Ye1ddMtKK0BDLylb4k7/o heGA1Yru6iyXle2kaG7v+OpQ/TrJHCJfkll1TKMmtMvG1CtcinAe8iOWvb9ycLMwWRg1 CnmGW6SF02wF52sQdNIbNJbO07vDO+H+JchiRYMf9P/qT+UMKlmpNRY7q17yorQynGLc idpRvRMC1pyaUnjB+g9Wan7BDttk9YRHRQeMMcXuhT3aRkuWA23j3Rs++xppbtSBt5TC cg3w== ARC-Authentication-Results: i=1; mx.google.com; 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 80si311286pfj.22.2018.03.19.11.19.37; Mon, 19 Mar 2018 11:19:51 -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; 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 S969285AbeCSSSQ (ORCPT + 99 others); Mon, 19 Mar 2018 14:18:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45894 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969276AbeCSSSM (ORCPT ); Mon, 19 Mar 2018 14:18:12 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6CDDB124E; Mon, 19 Mar 2018 18:18:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hou Tao , Jens Axboe , Guenter Roeck Subject: [PATCH 4.9 001/241] blkcg: fix double free of new_blkg in blkcg_init_queue Date: Mon, 19 Mar 2018 19:04:26 +0100 Message-Id: <20180319180751.230597698@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hou Tao commit 9b54d816e00425c3a517514e0d677bb3cec49258 upstream. If blkg_create fails, new_blkg passed as an argument will be freed by blkg_create, so there is no need to free it again. Signed-off-by: Hou Tao Signed-off-by: Jens Axboe Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- block/blk-cgroup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1078,10 +1078,8 @@ int blkcg_init_queue(struct request_queu if (preloaded) radix_tree_preload_end(); - if (IS_ERR(blkg)) { - blkg_free(new_blkg); + if (IS_ERR(blkg)) return PTR_ERR(blkg); - } q->root_blkg = blkg; q->root_rl.blkg = blkg;