From patchwork Mon Sep 21 16:27:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263746 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCA3EC43465 for ; Mon, 21 Sep 2020 16:35:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87CBA239ED for ; Mon, 21 Sep 2020 16:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706101; bh=h+v2S6xgIFkPvn5yhFLV4tRg9k2/Gu8CcLZbSNqyfkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mR2YnL+yWXFJ8LorVlmgzxSMOkwabrWCPhD/xV7uLVIsKE3IbDNQQYmd91a2SLGNe EE290XoftHPHkxTwcZqYxZZRGmqrfDy/ohBn238keIEDquGR+paBvvzdNucunczFJN 32vbh8UTUDp87uTiiBlxop74RynDiEETV6XDvSdY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728419AbgIUQe5 (ORCPT ); Mon, 21 Sep 2020 12:34:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:33174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728754AbgIUQea (ORCPT ); Mon, 21 Sep 2020 12:34:30 -0400 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 320C723976; Mon, 21 Sep 2020 16:34:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706069; bh=h+v2S6xgIFkPvn5yhFLV4tRg9k2/Gu8CcLZbSNqyfkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DCqjsIgSp9mQoKTNqw9QOEvut/HQJppelWLMyf+U2mIjjebvwWGAvndlo5ySXQMD+ QyDDFY4n+YdcxBuCZSQJH6aFFrxsvu7p4K5xwuS5Ygvl1daqzlYrT/KwmWSlwWEvbZ Gev5F5dDBb8eyb6xZcKwzjzskU1sK8DQTHyrJxYE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kamal Heib , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.9 03/70] RDMA/rxe: Drop pointless checks in rxe_init_ports Date: Mon, 21 Sep 2020 18:27:03 +0200 Message-Id: <20200921162035.288055751@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.136047591@linuxfoundation.org> References: <20200921162035.136047591@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kamal Heib [ Upstream commit 6112ef62826e91afbae5446d5d47b38e25f47e3f ] Both pkey_tbl_len and gid_tbl_len are set in rxe_init_port_param() - so no need to check if they aren't set. Fixes: 8700e3e7c485 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20200705104313.283034-2-kamalheib1@gmail.com Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c index ab6c3c25d7ff9..c11d33a30183c 100644 --- a/drivers/infiniband/sw/rxe/rxe.c +++ b/drivers/infiniband/sw/rxe/rxe.c @@ -168,9 +168,6 @@ static int rxe_init_ports(struct rxe_dev *rxe) rxe_init_port_param(port); - if (!port->attr.pkey_tbl_len || !port->attr.gid_tbl_len) - return -EINVAL; - port->pkey_tbl = kcalloc(port->attr.pkey_tbl_len, sizeof(*port->pkey_tbl), GFP_KERNEL);