Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1238838pxu; Mon, 23 Nov 2020 15:37:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnL32P2K26KcCN14PVOAEXy2uGG4YF8g3vVGyYSyy5txlhJlJK0MeeZ01Ykz0MogTVQF8D X-Received: by 2002:a17:906:3648:: with SMTP id r8mr1858909ejb.145.1606174657178; Mon, 23 Nov 2020 15:37:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174657; cv=none; d=google.com; s=arc-20160816; b=SPRN2KyGVe1yk/DiXhcKcDZobHeeckOFDoYA4a2n9W0WOrFNh4H0eAhlaDhYAhxVmL aRAugVJ8zOs+UTN13eo7GBNpDDD7MqJyAxerLr6R+OOFCwV86ebtt3oBPBH6iKk3JF0Q JppVo7vNWpkaCSqq6fu0R3U55/Jy6ShMoLPl+Dpd11qH/KsJ8LdhK7rZIcFPsZaSSM6p XNQby+p6c+q8iVz55SJMQ4Zt+JT/uwaahTpAmxCzHZ+n5OomAx7zDkaqg3M/UeHNPfp3 eEoUuk1vc401s/MlLACt2xGs7ldHslpF4sTsssmMEaZTSaHdxEAeAmGhNsslM2E8lhpK e4FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Z9nTg7P1kLusyngqCvLi/jAKgQPwN6fwISIHr7nbFV0=; b=L5ywxs1eHT2jmfAwW4bzf03hBirXnVn5ovDY3sT03VJ9UE1OMqUXBGJwsyF6Kio/2C J2+Pwp1SxoJ0WZ4N5SIhrO8OdG4nVdP6+ZE6n3csiq3Kuzs6FODE1ailA9hy+4J1vww3 4VLTh9gAtfvJzSK9sfpOAq2/fwUlAqSJ3yxiy6DRvxQVFoZI85zqZBAwBsvpwUaUiaal q3TUn7JtF3Gx6QqqbRz99ASOCuyqojSchZMWsPBChr63bhoFk1tF9CJGaSajdz6lwBA6 W1pz2LOfSVTwwL8xXhLzkid/HdYlSzuGraci+ToKNaGsCbfInGFCt1KCzv7MvxGEJPzm 1IEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uOdbbxgz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a42si8371370edf.129.2020.11.23.15.37.15; Mon, 23 Nov 2020 15:37:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uOdbbxgz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731701AbgKWMg3 (ORCPT + 99 others); Mon, 23 Nov 2020 07:36:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:48482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731652AbgKWMgV (ORCPT ); Mon, 23 Nov 2020 07:36:21 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 327492065E; Mon, 23 Nov 2020 12:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134980; bh=uanWpzw0cSD1CRpqI7w1hh54uRsZf+ZiopiHfXKrNXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uOdbbxgzRjmHF9fZ5VILhcxebnxe7t/wMRU1pwRIlRNUnepvrLEaq1pqhrFNZ87eM 4w2KTgZQTHqJpnyD2TmX4vS8tbd6rUO1i6kJKDVCLCgL0FVdcnCfAVy50aA3y2dLIL XTpV4r3kB4pALFj5fS/lZs1qX1XCwXdr8hUok6rE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Karsten Graul , Jakub Kicinski Subject: [PATCH 5.4 021/158] net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() Date: Mon, 23 Nov 2020 13:20:49 +0100 Message-Id: <20201123121820.956849688@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Karsten Graul [ Upstream commit 41a0be3f8f6be893860b991eb10c47fc3ee09d7f ] Sparse complaints 3 times about: net/smc/smc_ib.c:203:52: warning: incorrect type in argument 1 (different address spaces) net/smc/smc_ib.c:203:52: expected struct net_device const *dev net/smc/smc_ib.c:203:52: got struct net_device [noderef] __rcu *const ndev Fix that by using the existing and validated ndev variable instead of accessing attr->ndev directly. Fixes: 5102eca9039b ("net/smc: Use rdma_read_gid_l2_fields to L2 fields") Signed-off-by: Karsten Graul Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/smc/smc_ib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/smc/smc_ib.c +++ b/net/smc/smc_ib.c @@ -191,9 +191,9 @@ int smc_ib_determine_gid(struct smc_ib_d rcu_read_lock(); ndev = rdma_read_gid_attr_ndev_rcu(attr); if (!IS_ERR(ndev) && - ((!vlan_id && !is_vlan_dev(attr->ndev)) || - (vlan_id && is_vlan_dev(attr->ndev) && - vlan_dev_vlan_id(attr->ndev) == vlan_id)) && + ((!vlan_id && !is_vlan_dev(ndev)) || + (vlan_id && is_vlan_dev(ndev) && + vlan_dev_vlan_id(ndev) == vlan_id)) && attr->gid_type == IB_GID_TYPE_ROCE) { rcu_read_unlock(); if (gid)