Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp662204iog; Mon, 13 Jun 2022 10:06:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u0bsIE5amG4BTH07LwpxrQW88XhYnigS7KMxrGhO7tHFHPAJna6/6x1Zi+lG090J8IhKg4 X-Received: by 2002:a17:902:db0f:b0:166:42b5:c819 with SMTP id m15-20020a170902db0f00b0016642b5c819mr40096plx.96.1655139983882; Mon, 13 Jun 2022 10:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655139983; cv=none; d=google.com; s=arc-20160816; b=Gw2IeABZeMWbP6Tp+4YTPoIe+orTWns42zsX3Ooq+zryErbh9yjARmkA6AVxHZwVGF LgO7S5pI6AP7NzsIrLSZ1C47LknEN62Xp1tNNnDVIqYY9cIDb7w5riVRmFki7iJOF1Ae 88cnlDW9iGafNE4J8OLHALO5P2ZQAbp1btEWxZaARSVyDaNRJRIWNqu/N15xNUkq9Nl5 c1ZVKiEEGZ2DEpU3KCy9hioH8Qm55vFHH1R3/qCJ6HgydN4+EO3StxK8YztRAaEw/tT+ atps9faX04dGD9lQLyGayy5PLxQqniLN4tNXZF5yAw+U9OTggLknwBHKnNnYifMZehPP 4qUQ== 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=ZzgnjerqS7bM4zcHs7qJlEdeVyLSKVRlo4xmdzp1VxM=; b=JoYiclm4sFb/Y+JV8E9wYyJibpaQ1pjomRprFDRNMiBEdWlQK/osW2v33m8TOqU2+K 5lN8xXORFgk7H9AndsRxexSTimC00Ml966wn7bsc6fu5YiIHOKSaOHu0ZvVWIiC1fMUN ULwwHPbbUp9I66SauDYIXzvQ3w6T93CX3XrFBkiUR8v2QXPlNVeAorwdIPzldfXrPdIS VC8KnN83SNG06+FVrwUlWhqAvLFXMJZAaAcyOoMPW7xI6ZfjgSUnDm0XDxkm0IOwZZzv yJnE/IPbwSwRTRdHoqm8INB260l0sSFmLSOBrC81ercolA+TKwL9inDLbOpsRp+7k1k7 GsZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AhWMC1qN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p20-20020a170902b09400b001663dfef4aasi9388333plr.141.2022.06.13.10.06.07; Mon, 13 Jun 2022 10:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AhWMC1qN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1378504AbiFMNlp (ORCPT + 99 others); Mon, 13 Jun 2022 09:41:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378911AbiFMNjY (ORCPT ); Mon, 13 Jun 2022 09:39:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF0F0793A4; Mon, 13 Jun 2022 04:28:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 072CA61243; Mon, 13 Jun 2022 11:28:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 130E0C3411E; Mon, 13 Jun 2022 11:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655119697; bh=rrdUq0+U2ydsV3HuaJAwxcFjpuqb+aKuO/e9fbI9Kmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AhWMC1qNHTsfVHC5NH/vQUQti5pgkTfUWvhlNb/P/NoW7d43GDMI2ODXectv9AJn6 xw9X1jgVA4EwhsHsP2DAZXiCrvNEDT9eztToQgy7lNxfZ7sS9Xf0RXfBSdg6vcZIao cSWVDoILXPD7//8KjmM3R0wR7Tt+66zT/R22J0/c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, liuyacan , Karsten Graul , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.18 089/339] net/smc: set ini->smcrv2.ib_dev_v2 to NULL if SMC-Rv2 is unavailable Date: Mon, 13 Jun 2022 12:08:34 +0200 Message-Id: <20220613094929.215867138@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094926.497929857@linuxfoundation.org> References: <20220613094926.497929857@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: liuyacan [ Upstream commit b3b1a17538d3ef6a9667b2271216fd16d7678ab5 ] In the process of checking whether RDMAv2 is available, the current implementation first sets ini->smcrv2.ib_dev_v2, and then allocates smc buf desc and register rmb, but the latter may fail. In this case, the pointer should be reset. Fixes: e49300a6bf62 ("net/smc: add listen processing for SMC-Rv2") Signed-off-by: liuyacan Reviewed-by: Karsten Graul Link: https://lore.kernel.org/r/20220525085408.812273-1-liuyacan@corp.netease.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/smc/af_smc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 45a24d24210f..540b32d86d9b 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -2136,6 +2136,7 @@ static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc, not_found: ini->smcr_version &= ~SMC_V2; + ini->smcrv2.ib_dev_v2 = NULL; ini->check_smcrv2 = false; } -- 2.35.1