From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH][next] net: aquantia: fix unsigned numvecs comparison with less than zero Date: Thu, 10 May 2018 17:53:58 -0400 (EDT) Message-ID: <20180510.175358.1296757435086922873.davem@davemloft.net> References: <20180510125201.19707-1-colin.king@canonical.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: igor.russkikh@aquantia.com, pavel.belous@aquantia.com, weiyongjun1@huawei.com, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org To: colin.king@canonical.com Return-path: In-Reply-To: <20180510125201.19707-1-colin.king@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Colin King Date: Thu, 10 May 2018 13:52:01 +0100 > From: Colin Ian King > > The comparison of numvecs < 0 is always false because numvecs is a u32 > and hence the error return from a failed call to pci_alloc_irq_vectores > is never detected. Fix this by using the signed int ret to handle the > error return and assign numvecs to err. > > Detected by CoverityScan, CID#1468650 ("Unsigned compared against 0") > > Fixes: a09bd81b5413 ("net: aquantia: Limit number of vectors to actually allocated irqs") > Signed-off-by: Colin Ian King This doesn't apply to net-next.