Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp173186imd; Wed, 31 Oct 2018 16:47:42 -0700 (PDT) X-Google-Smtp-Source: AJdET5dX9ykBJdWBDCLkCSkQyVkBW3B/7RVhHEci53Ed8CKK0ecgperfaZPzBF4vnBhnXLCPOaNh X-Received: by 2002:a62:6181:: with SMTP id v123-v6mr5413863pfb.117.1541029662032; Wed, 31 Oct 2018 16:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029662; cv=none; d=google.com; s=arc-20160816; b=d0zfsX8NySXYBWGP0uFRlZITOXlodcwXdzX3z7Mz/843vtlsaoqfF/mfZqR7crh0+y wnrWaIPc6m5HFZoDZ9+Xpw+8d9ziHK4AxqTaR+ZzeX+AUpW00ohHMyXqqwrzUaPpHTGU rpsniIK2ZivXnVcTg4ra1xjWa6tRuykvjQibthtsa//Kam27tA9ECKdVOpksbImLHpzl grxRpugIG+t5dIyBY+3ACMKhiYvQOyDmMlorJ1OYbfk5vA9hOu1jqVEqwgY95yjUEwSS KXdHwVbO7gwG5Gcr5SSnbzWpgoSce4PmkwlDqY59jT62m/RcdH6+WYKsuq0phaTblstm uP0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=YjnIqreW7SC3JqAV/Xotwv9VlEup6DjlYAZTrrprvPw=; b=vvBjwDQ0D++jEcER4nIof1jdBnvXgzGPDUXgZbHjm5vkLOZVCr9xK2piVUxsH4qQU8 EWLMhvxm5Z7OFYHp2lPZwwZg2HFrURuPsys/yImTUEdV0lpBP1XERhhmxnoSLgCd8Boq HqT2mGEBvBEJPYZfdwwgprUXlD/j02rRkqooKNVNNX3gSUCRP13utQLaISwGqoN1A91w hCmA9e61Wnt9S1m/G0PW2Jc3+S6qW6ou6V/1OXAE+grXFJZpSVZThotmhawphJ9zCNEo qE4nu9bmA/GlwmQgwM86of2buDyVQjHEclEUDnKb71c5nVxPMgdvrbRdUaDVw5hDEYIB /8YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SG9h+E7T; 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 91-v6si29472205ply.48.2018.10.31.16.47.27; Wed, 31 Oct 2018 16:47:41 -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=SG9h+E7T; 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 S1728983AbeKAIqP (ORCPT + 99 others); Thu, 1 Nov 2018 04:46:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:55074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728813AbeKAIHV (ORCPT ); Thu, 1 Nov 2018 04:07:21 -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 9A48720830; Wed, 31 Oct 2018 23:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027231; bh=7ndQ0liK/ZwWE3jGzI/qgSNUSapHwibkmlzajcTlSTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SG9h+E7TT2LPTwKj0CTjb0jLnT5OrMYo2SX1q9ZhPwyKGSN5UmPkqQ56QbmSOllwD d530VX1nHIgxYjKg3cBRSlkF6SH7OIZ1Ht6YqJXSQXeVKhsmeiuO2KouN0y204gOEf lHOEpq4+ks8IsVKTBoHM4mm5Cp4qSZITMcpNSuig= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH AUTOSEL 4.19 098/146] RDMA/cm: Respect returned status of cm_init_av_by_path Date: Wed, 31 Oct 2018 19:04:53 -0400 Message-Id: <20181031230541.28822-98-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky [ Upstream commit e54b6a3bcd1ec972b25a164bdf495d9e7120b107 ] Add missing check for failure of cm_init_av_by_path Fixes: e1444b5a163e ("IB/cm: Fix automatic path migration support") Reported-by: Slava Shwartsman Reviewed-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/core/cm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 6e39c27dca8e..4c533275d1f2 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -3292,8 +3292,11 @@ static int cm_lap_handler(struct cm_work *work) if (ret) goto unlock; - cm_init_av_by_path(param->alternate_path, NULL, &cm_id_priv->alt_av, - cm_id_priv); + ret = cm_init_av_by_path(param->alternate_path, NULL, + &cm_id_priv->alt_av, cm_id_priv); + if (ret) + goto unlock; + cm_id_priv->id.lap_state = IB_CM_LAP_RCVD; cm_id_priv->tid = lap_msg->hdr.tid; ret = atomic_inc_and_test(&cm_id_priv->work_count); -- 2.17.1