Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5657334img; Wed, 27 Mar 2019 12:35:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuBm3nv/DckiahoLOk0prmlds+PeQuUoyyxXXlRKft2Xv229YaGjyPqkBffKLiGbfjG/pm X-Received: by 2002:a17:902:e305:: with SMTP id cg5mr8859604plb.340.1553715318410; Wed, 27 Mar 2019 12:35:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553715318; cv=none; d=google.com; s=arc-20160816; b=to6hddufmR3RzeLyRUFqNGodx5Iw/+dZjKggXgG21hofviwFfQm+TNHvyoGwtkUSDZ xP2wVJZmAjheUTRbavOZ7IfxHGqSZ1p3LSCLxulqIeeVaDehXczIDnYSUXVf35EDkYYS OSSqQrI+Ih8NzrsokqZTIOUlyhv1/g6joYwBBicf9nYBrCuRlH8iaIKcLKZTmlcv/7As OsJOt8A9oXhHftPE7Wn0LilGsxtTt7y49Z9weU4Y3LX/EbaO6LeMKmNJ8uutXt6mHXf3 +nk9TXVwhFxVnoYvDjiThF4WkCBDxCGi4+oYUfPXrBNWsUf4b0P1taP9vvz0A8AllTsX iLVQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=J8mRt14vl/cx0Uy8hcAKoSxYiUwiQJ504ELyltQ24Tg=; b=wqTHxVyl9HHKZQyHA4RMSalk4Ad7/bpp4S//7LL7sa2e/lYTKDU5u6lCODxLhrGdaY XRnHRcVrD2vFDimufyZ5EgWqVgcLTfE6bqfkfHhzc4tPJbP8pJvpv7VJrJeoBbLXJrXx aVnZeMFtyQk/0IRL8Oh3cqixbmiiEbCf62lDs9Ok7dbmHGoT8/Org8mBNBHoJzKWCTQM BG3GvyKf1SXiZMl3qH+p1mBlITsXVTxGZJsRlZb4gG7vuhV0fEss7O20fo4erX+RcLaT CiUSgarNuAfn+Wu71JRGLg2n7kEKAed2PH7w8om+Pen+oiR6lFH3N3MpIaUqlXVJghvn eZ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HRI3Z4PI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g40si20612107plb.146.2019.03.27.12.35.02; Wed, 27 Mar 2019 12:35:18 -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=HRI3Z4PI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728961AbfC0SCF (ORCPT + 99 others); Wed, 27 Mar 2019 14:02:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:41748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728734AbfC0SCB (ORCPT ); Wed, 27 Mar 2019 14:02:01 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 724412087C; Wed, 27 Mar 2019 18:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709721; bh=uz8mXD3eUvMMUfRjhnCAmYS1qH3cmWt174p6SZDTbzM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HRI3Z4PIVMGBjjGwxNyHdowIwmue30wqzo/fvcXfkUYWuYDnSKOmq7nLRnTeoB5jb 93BTjxNtaMs1QOuv/nXzG5toj9qxei9082r5fFb85keuGuGFpq9xHhrNw09Th0lMJz eETwhDTX03UPRNjCUyfqfnU0rLh4D3lDVzjNOCl8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: James Smart , Christoph Hellwig , Jens Axboe , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.0 002/262] nvme-fc: fix numa_node when dev is null Date: Wed, 27 Mar 2019 13:57:37 -0400 Message-Id: <20190327180158.10245-2-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ Upstream commit 06f3d71ea071b70e62bcc146cd9ff7ed1f9d4e43 ] A recent change added a numa_node field to the nvme controller and has the transport assign the node using dev_to_node(). However, fcloop registers with a NULL device struct, so the dev_to_node() call oops. Revise the assignment to assign no node when device struct is null. Fixes: 103e515efa89b ("nvme: add a numa_node field to struct nvme_ctrl") Reported-by: Mike Snitzer Signed-off-by: James Smart Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Mike Snitzer [hch: small coding style fixup] Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/nvme/host/fc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 89accc76d71c..c37d5bbd72ab 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -3018,7 +3018,10 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, ctrl->ctrl.opts = opts; ctrl->ctrl.nr_reconnects = 0; - ctrl->ctrl.numa_node = dev_to_node(lport->dev); + if (lport->dev) + ctrl->ctrl.numa_node = dev_to_node(lport->dev); + else + ctrl->ctrl.numa_node = NUMA_NO_NODE; INIT_LIST_HEAD(&ctrl->ctrl_list); ctrl->lport = lport; ctrl->rport = rport; -- 2.19.1