Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2572718yba; Mon, 6 May 2019 08:11:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQKPyw0Dm72rjLtmw8BIDSHxfAx4lem5YlL8oFjPaRKHPTP2BbyH14sgXl6kSzzYvUBmOD X-Received: by 2002:a17:902:567:: with SMTP id 94mr32151062plf.120.1557155463435; Mon, 06 May 2019 08:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557155463; cv=none; d=google.com; s=arc-20160816; b=LfJz/2IflqHHAJdhoP4lsRqOazrnswmOUveoubuXX3WAtGItuZQ0HQitvJSH/fDSj0 nrdSdBREQAQAVyUC9V8pDD+P7enBst8fnho+uVxeIBdMtA7PXdNBY7Cf6jwc2uSR9nQq xR74uurtYDEHrbYBlbooJXnZliW9POlsgFU/WAgBppIx/sum6mniTpYvROgj6+7RkVA/ Wjyrg6hxc3a/HTmRbLAbY6893WzmsbPwEBehUbPbTBOCZonSB4isLNpEhrlDTc6Uftev Kl+6T/g2YCJO9yWkm0ER1JYlGPbMMmFevu7LWQbu6QNuC7pFOZ4gB0j2tMrVxh4RQNx6 4jfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kQUkdMpqdovUZ25jSq7KkCFtkasDo2xYSQbWq9aVVoI=; b=F+MHKfAzdGOJOjBoYeETHYSZLOmFRJG0cZxJxjQYe1etfsKdkwYMhySfyYpcBDoc0X f8I9D+5VBq2RzK3w3S29nOggDBQ2yM//llS6U3aV1Qy7NdI0rfKjtO9wwrJePn+IbD6E C1rJLjPCFuHntd0UzM9hzd4dqLIA/sYC2r3W2LhlCw5t0ZheNGubVEYJfAutF+3odraB 0UskZ87AH7mliw48ToHjbY2ErK2kTfpZZnFpbE78cYD5+gSw05pDfbOUbUX9TvK47Wp1 pY4AV3T1NcM19cl2egvvBrAVjHr+IZ9yxsRxSgdXiCqQBsECCVXfhqEixjQnUFzGX2ss 0+Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QXEgVl7n; 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 f18si4057191pgb.36.2019.05.06.08.10.45; Mon, 06 May 2019 08:11:03 -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=QXEgVl7n; 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 S1727067AbfEFOgA (ORCPT + 99 others); Mon, 6 May 2019 10:36:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:56178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbfEFOf6 (ORCPT ); Mon, 6 May 2019 10:35:58 -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 86A6D20C01; Mon, 6 May 2019 14:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153358; bh=Cw5hhRwDUAOELZyul9Nmi2Wf+0JI+FFNTIywjwjoTVk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QXEgVl7n7ZvmfiXJ2i5i5fm7qdbgQr03ztsQVmug9jAELbmowoLJXQ+K8jnsIFllJ Gg6Ch4uRKfa+RPk+dFtPZMniFgJl+DTzO5A8L65ZiNoaQX0ydf4Enqm1o3LJ6RwRxc KEFI1M1IeeD6hgPcf/sCcQooerXkOzhCDgheFunQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ming Lei , Shenghui Wang , Jens Axboe , "Sasha Levin (Microsoft)" Subject: [PATCH 5.0 059/122] block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx Date: Mon, 6 May 2019 16:31:57 +0200 Message-Id: <20190506143100.317630354@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit b9a1ff504b9492ad6beb7d5606e0e3365d4d8499 ] kfree() can leak the hctx->fq->flush_rq field. Reviewed-by: Ming Lei Signed-off-by: Shenghui Wang Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin (Microsoft) --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 16f9675c57e6..97eba6d23425 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2341,7 +2341,7 @@ static int blk_mq_init_hctx(struct request_queue *q, return 0; free_fq: - kfree(hctx->fq); + blk_free_flush_queue(hctx->fq); exit_hctx: if (set->ops->exit_hctx) set->ops->exit_hctx(hctx, hctx_idx); -- 2.20.1