Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3481036imu; Sun, 11 Nov 2018 16:04:59 -0800 (PST) X-Google-Smtp-Source: AJdET5dKrozR0W7gqXlTklLKdaxI61wC4aL+3b4PX1MHXbf0+5UYY9KFVGBQ6/4srxjrT4/rA9Bd X-Received: by 2002:a63:61c8:: with SMTP id v191mr15703725pgb.242.1541981099326; Sun, 11 Nov 2018 16:04:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981099; cv=none; d=google.com; s=arc-20160816; b=JDkWep4/RyklgOfNlQPYbyVuMkiHp13Z9dTJf0QzgV4ALWsgnS3dSSDyfMNfSr/sf8 u8V1N10bdf8gQbIbr8KcDh0//IB8a0Ro1OVnzzQxffnsjzwbXLJoJwAoB4MeLn1WoW61 NmUM2MRAlvYwKR76aYbSRvGQkaGTl89TimaNzRY2z8yTSWb8yRkXXTnNeWtQlDTd/LpY yRGiJGYem3QNtBlngtsYvacqPt+yq9xscAxCfQHAvfGDxrVcQAICu9Q5zOBTvcI2P0TQ xVuH+XZnDubTkH/519qVHA5YM2CQRnEWjhAnt8Yvw5M5Q+Csq07tSe93xiqaltOxho5Q IOdA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Y8/J6TplsKGPpyKnhtabPYfuLgqB964LXZkIUvtb6vY=; b=o2msu9Sc5o80bkliO44O+lLRGrj6plaQQmP6ktJLocNEEuA07NgoFbDr0w8a4vKVcF VWKZ0oV4/p3VfQkDLxHmUwY8bw3Yc7+KZPFpFxiYn2HaRbJiNmnRP/vgITm8PevYiZnW qg7kBgV9XQCjR0ZQlKGGLjKGpm1tGifMDovoAjDwM4PCH9Hjla+IVouiHLhOmXGJixsu 4tFqSQlplX8YPSnOARGFuejvoW4NJr/Ik26UxujFd7AtLahD4OmKXbXNY3j1e4HMLDAC neL8JrADlZbM2H/Gs0ECBZ04ErJGJddhkvHjv+adwd8tpao5AHm/pTrEok3fB0YbnBfY mEcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ir5oEHU0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b24si4648086pgi.308.2018.11.11.16.04.44; Sun, 11 Nov 2018 16:04:59 -0800 (PST) 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=Ir5oEHU0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732092AbeKLIRt (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:34452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732056AbeKLIRs (ORCPT ); Mon, 12 Nov 2018 03:17:48 -0500 Received: from localhost (unknown [206.108.79.134]) (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 0504F208A3; Sun, 11 Nov 2018 22:27:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975273; bh=388qjFT6CyNdyTPXybAqNcnfUPRy4uQh4cqDOW2NonQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ir5oEHU0dJ2epCaBDHGwSGTRZgzX3iVuSJO//1Yu7EhiW0CPHR8jaTj2tlf/eM5Au IZxgpDHs+Hu9LvdDTr1KQsCta8aO7eROYNLn+KfVpDmujXxRngY45LxHPuXlsY6jmS QT49uE+kGOxSp9Qp7EJoDMAp+MU5jRBVz9ikypYQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Slava Shwartsman , Parav Pandit , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 143/361] RDMA/cm: Respect returned status of cm_init_av_by_path Date: Sun, 11 Nov 2018 14:18:10 -0800 Message-Id: <20181111221640.612934902@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/cm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -3292,8 +3292,11 @@ static int cm_lap_handler(struct cm_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);