From patchwork Mon Mar 27 17:43:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9647261 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 D49C4601D7 for ; Mon, 27 Mar 2017 17:45:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4123282E8 for ; Mon, 27 Mar 2017 17:45:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7F2328403; Mon, 27 Mar 2017 17:45:06 +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,DKIM_SIGNED, DKIM_VALID,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 45615282E8 for ; Mon, 27 Mar 2017 17:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751350AbdC0RpA (ORCPT ); Mon, 27 Mar 2017 13:45:00 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:34263 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbdC0RpA (ORCPT ); Mon, 27 Mar 2017 13:45:00 -0400 Received: by mail-pg0-f41.google.com with SMTP id 21so46955868pgg.1 for ; Mon, 27 Mar 2017 10:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=gxXjlFj/hgudW/8y2MB7k8BLwJGLDUruBGNElHXcfzk=; b=r+bF5Q+GVwWY/Pbse0Sbd/YVRJvLhqM99HQD4euoCtIlEYly6ATePHt2XwiQVaLlo9 RuuSRGDAD802i7lGS7suJRTms9tTwmIJjNqFK3CaigHkFKfI3OD4EIKjr1o5To6Ywn8a S0BXO2spfHpRZ8ldOu9332M+vW8hpoVsxdPWxdcduMmvmnheW4NxOek+5Y4kZQOmsY2L CWLE4ilNuRqFjbiwlv5SftSd0MVB+UsKhvphdJeAHgsXw+yZx8NQNp6hKLzNll3uLphN wYHM6xpaOJfAXO8azJ72AoL/FPuIzEFBARJMSrBdMxBEb5t+id1wZXwDUK+EcvGwyzmL x+Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gxXjlFj/hgudW/8y2MB7k8BLwJGLDUruBGNElHXcfzk=; b=tXpFa8A3Nnf6JBcS6CFop+3IohuI+MYLVm7XVL0zxoC8JVWi+ltrRJyFsB1BMufXU1 mIyJWavMBUDAtUyDvsmpHgA4/YA/kSr0/rG7eiBp9J1tjjHJisD7zdH0CR6zgD/DtCZQ kTY7Dtsh7/CG0Wkgx5U9yb663xXhii2ewLBIJw1ATcrXetFe9soUhpGtYnkuBdmvNOfe qjKeYURvXOSqQnKzcFBnGLOBth32A/46B2l2FnBGEhTi+d8P9LxCbCG+Z21dVTzu5Pe0 LpNNINxp4HD3waiQJWSlIQk2py9DXHZsDGEmFqoH2PjDW5gl7qRTdow1uIyey8rXK6Pg 6cHA== X-Gm-Message-State: AFeK/H0guT3qzm27acxPVShsEPdstV2zR6NQVPMTEsx2WBDrB1tyeerhWoOvDhpbChX5A0ck X-Received: by 10.98.79.90 with SMTP id d87mr25806425pfb.126.1490636698353; Mon, 27 Mar 2017 10:44:58 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::f:853d]) by smtp.gmail.com with ESMTPSA id q23sm2431806pfg.63.2017.03.27.10.44.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Mar 2017 10:44:57 -0700 (PDT) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH 1/2] blk-mq: fix leak of q->stats Date: Mon, 27 Mar 2017 10:43:58 -0700 Message-Id: X-Mailer: git-send-email 2.12.1 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 From: Omar Sandoval blk_alloc_queue_node() already allocates q->stats, so blk_mq_init_allocated_queue() is overwriting it with a new allocation. Fixes: a83b576c9c25 ("block: fix stacked driver stats init and free") Signed-off-by: Omar Sandoval Reviewed-by: Ming Lei --- block/blk-mq.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index c212b9644a9f..9c6b39bd8358 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2212,10 +2212,6 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, /* mark the queue as mq asap */ q->mq_ops = set->ops; - q->stats = blk_alloc_queue_stats(); - if (!q->stats) - goto err_exit; - q->poll_cb = blk_stat_alloc_callback(blk_mq_poll_stats_fn, blk_stat_rq_ddir, 2, q); if (!q->poll_cb)