Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2967069ybk; Mon, 18 May 2020 12:19:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwju+MMMF2SnhV7rwoPKH45ykSBYSqYR8IWDy6RU8o7L5jE2OS7GVuxNG85FNF9p2clN4Ok X-Received: by 2002:a50:b202:: with SMTP id o2mr14586017edd.251.1589829548361; Mon, 18 May 2020 12:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589829548; cv=none; d=google.com; s=arc-20160816; b=KKpzw61+ryh3o9VZTjxaLFSP3L3210BvE0rwhs3+vUSh/7dJk4bFD4ktwV+4mVouTD GMDf/9n1MlT2cur+lpCVJcxfg5u3cWzpiXC4n5LGNiZVBTP8f7wT6BhN6dBWQk07Ux0V fsnXEULdwuIEIvFPJJdp46C6/pSMtdvagHxfUchjgAkId+xeA85ZXHiwzYuIT8caV9kY U/uvn9ipghhF4aYDq3Ns2CmBQg7nb+80mHEyAL/x723lr2Odk3zZf/aitKMLgUmxWOGR TwhEgsGSX28VVZ3nYNHId+L6+DCK24Np/BBEsk6zI1L2NwixU11MA0sWVAedZMuoi56k g3tw== 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=CNXgZKndx+DFm08waeR66DNg2TZXPuDpEEIH65OL+tU=; b=Oq1BwuaU5dbIE0MC3twrqVMvtPS7Js/m9UimXUy3E5RDScY9o2/hshYRu7Qwg5DM8C CiA/8O9mnQrjjr2cxE0AEoTWguWDsHTZDeoMlwjq37Xo3CWwrTGQLyBKJAc0XwBP1jT1 Zvw4T/acOLbRNz+HX7mx9a2tIiaE9SCFZWa1kyAp/PUUk6gdcL5DWqbGk6/vWkn//1pe xpN1afdoXGCxpSM3AdQ+uzHOjYfOYK5OaIT4OSlw3M4tUoTpkQPNT9LafI5Vb88fvxfu T0xMX1zNEB0VauKDJ4ttGPJOXlFH8VlAe4Qt6YMKVWaxPl34f6G/XWtB7uvh4Qlfah0x 6eEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=W1jpyDVC; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e23si6814855ejr.357.2020.05.18.12.18.44; Mon, 18 May 2020 12:19:08 -0700 (PDT) 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=@kernel.org header.s=default header.b=W1jpyDVC; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728704AbgERRvg (ORCPT + 99 others); Mon, 18 May 2020 13:51:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:54240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730330AbgERRv3 (ORCPT ); Mon, 18 May 2020 13:51:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 188C320674; Mon, 18 May 2020 17:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589824289; bh=t3npKBEsuRcAzaeEdhUZ+UJDeNrUl67D2yV/RLVnfT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W1jpyDVCSdPt1rWgch2fCXfS2otQ1mvhUvMOTxyJU7pSxq8BilIo8gUpOQm0kK1lk 7uBYzDsbtr3Jzg/MajHQgi1iwrlLsz+pmOlqpekewxBBZx7LvBs9NqrG4lBKgZ5CbT jsjWfS1VGFcLdkZarypt4s6Vfj/t4azvBMzwPtk4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Shiraz Saleem , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 33/80] i40iw: Fix error handling in i40iw_manage_arp_cache() Date: Mon, 18 May 2020 19:36:51 +0200 Message-Id: <20200518173457.154389444@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173450.097837707@linuxfoundation.org> References: <20200518173450.097837707@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Dan Carpenter [ Upstream commit 37e31d2d26a4124506c24e95434e9baf3405a23a ] The i40iw_arp_table() function can return -EOVERFLOW if i40iw_alloc_resource() fails so we can't just test for "== -1". Fixes: 4e9042e647ff ("i40iw: add hw and utils files") Link: https://lore.kernel.org/r/20200422092211.GA195357@mwanda Signed-off-by: Dan Carpenter Acked-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_hw.c b/drivers/infiniband/hw/i40iw/i40iw_hw.c index 55a1fbf0e670c..ae8b97c306657 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_hw.c +++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c @@ -534,7 +534,7 @@ void i40iw_manage_arp_cache(struct i40iw_device *iwdev, int arp_index; arp_index = i40iw_arp_table(iwdev, ip_addr, ipv4, mac_addr, action); - if (arp_index == -1) + if (arp_index < 0) return; cqp_request = i40iw_get_cqp_request(&iwdev->cqp, false); if (!cqp_request) -- 2.20.1