From patchwork Thu Feb 18 21:56:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 8354791 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3C976C0553 for ; Thu, 18 Feb 2016 21:56:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 683CF203B6 for ; Thu, 18 Feb 2016 21:56:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A41612024D for ; Thu, 18 Feb 2016 21:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424805AbcBRV4k (ORCPT ); Thu, 18 Feb 2016 16:56:40 -0500 Received: from mga03.intel.com ([134.134.136.65]:6973 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422974AbcBRV4i (ORCPT ); Thu, 18 Feb 2016 16:56:38 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 18 Feb 2016 13:56:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,467,1449561600"; d="scan'208";a="50461173" Received: from dcgshare.lm.intel.com ([10.232.118.254]) by fmsmga004.fm.intel.com with ESMTP; 18 Feb 2016 13:56:37 -0800 Received: by dcgshare.lm.intel.com (Postfix, from userid 1017) id 85EFDE0C64; Thu, 18 Feb 2016 14:56:36 -0700 (MST) From: Keith Busch To: linux-block@vger.kernel.org Cc: Jens Axboe , Keith Busch Subject: [PATCH] blk-mq: Fix NULL pointer updating nr_requests Date: Thu, 18 Feb 2016 14:56:35 -0700 Message-Id: <1455832595-20485-1-git-send-email-keith.busch@intel.com> X-Mailer: git-send-email 1.7.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A h/w context's tags are freed if it was not assigned a CPU. Check if the context has tags before updating the depth. Signed-off-by: Keith Busch --- block/blk-mq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 56c0a72..68981d8 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2330,6 +2330,8 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) ret = 0; queue_for_each_hw_ctx(q, hctx, i) { + if (!hctx->tags) + continue; ret = blk_mq_tag_update_depth(hctx->tags, nr); if (ret) break;