From patchwork Wed Jan 25 00:37:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Tao X-Patchwork-Id: 9536239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D3CB8601D7 for ; Wed, 25 Jan 2017 00:37:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C489C26E69 for ; Wed, 25 Jan 2017 00:37:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B716B26E98; Wed, 25 Jan 2017 00:37:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44BCE26E69 for ; Wed, 25 Jan 2017 00:37:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbdAYAh0 (ORCPT ); Tue, 24 Jan 2017 19:37:26 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:59893 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbdAYAh0 (ORCPT ); Tue, 24 Jan 2017 19:37:26 -0500 Received: from 172.24.1.137 (EHLO SZXEML423-HUB.china.huawei.com) ([172.24.1.137]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id COL57264; Wed, 25 Jan 2017 08:37:20 +0800 (CST) Received: from huawei.com (10.175.124.28) by SZXEML423-HUB.china.huawei.com (10.82.67.154) with Microsoft SMTP Server id 14.3.235.1; Wed, 25 Jan 2017 08:37:17 +0800 From: Hou Tao To: CC: Subject: [PATCH] blkcg: fix double free of new_blkg in blkcg_init_queue Date: Wed, 25 Jan 2017 08:37:36 +0800 Message-ID: <1485304656-8844-1-git-send-email-houtao1@huawei.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- block/blk-cgroup.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 8ba0af7..58fb0dd 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1080,7 +1080,6 @@ int blkcg_init_queue(struct request_queue *q) radix_tree_preload_end(); if (IS_ERR(blkg)) { - blkg_free(new_blkg); return PTR_ERR(blkg); }