Received: by 10.192.165.148 with SMTP id m20csp1302240imm; Thu, 10 May 2018 08:37:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqQ6O1V+UFnQHhVe2qtjacSnH1oC8/q02j1o9iHubrzG36XhxqLgCDZIq2fvkMRAs19lcwr X-Received: by 2002:a62:581:: with SMTP id 123-v6mr1875262pff.38.1525966648889; Thu, 10 May 2018 08:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525966648; cv=none; d=google.com; s=arc-20160816; b=Ltx82Xy4epqAvlRR+eI77WvMNLsv0ZgMuH/gwTFKh6BRy+5ae1DNPz0GufBf20CtmF bs+SpB2s42KHnP+FyvVCTV+/whVQVLm3xWg6dF2EP3Mk2pIAIwpPkxRnufBa8ZJkPRux 8LF+82PM6jbKahbdDC2jV2uP2eWEUtlg7m499GEZ51tPiF/W4pmX8/HwYjXF4MuYjY8B fH5RKi0bh4FHcb7K/yZrQSw7YdpiEtlohYjaNjRtZLfBRDCmF680QVmYKRYpsVw/JxiZ SlJEBCu4sVSupeN5Sjkka1eC2/EWHmJuAxj60kbC/osLDI4/F8Nb2syJzSdd1hfB8glO iymw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=jX+jyXwSuQ5eq6NkvotD6s+DkYEy35ZDs72hzEmUetA=; b=WpB3xAKy4m/i5aMWbyXqLWNUTHzvCFwFe0tKmNHb9hGIv+/+uBFAKxORK5gxAfPNli S0ukGzI4wa5SrKJmKdbjk7Gzics7Y6nr70AZwFbu0+xOhWJ0YJ2UVaV/e+kJuLoeZkl/ PyNkh4uzQYTxDI6Oi+4XJrlrCoirTWs8FhAr0QvlsVkvJ56apgleyeMcNAYwsjMwqZFM oLgc6Fnj6jyq0MS4Mdkqk3fCiq8Ydli74CK0T6PnISVJec9GpW2EMOJmkGoXC+1Ua3Fy +3+ms1SvisboSBAq0mn8ImUA+a9hzGNtWGsCyqNfGJTaoMyKy7zUNy/FTKod8KYGF3Kz vbYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@AQUANTIA1COM.onmicrosoft.com header.s=selector1-aquantia-com header.b=u+e8EfdK; 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 f91-v6si1005189plb.510.2018.05.10.08.37.13; Thu, 10 May 2018 08:37:28 -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=@AQUANTIA1COM.onmicrosoft.com header.s=selector1-aquantia-com header.b=u+e8EfdK; 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 S966299AbeEJPgj (ORCPT + 99 others); Thu, 10 May 2018 11:36:39 -0400 Received: from mail-by2nam03on0057.outbound.protection.outlook.com ([104.47.42.57]:60480 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966093AbeEJPgg (ORCPT ); Thu, 10 May 2018 11:36:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jX+jyXwSuQ5eq6NkvotD6s+DkYEy35ZDs72hzEmUetA=; b=u+e8EfdK131w4/Zkd9rWPPlnPo2JL1lYo9mB/p6pZVJNylZv1df4W9DtZ8gOExWD0rF96Fn1bMp4ftp4fbQIqxLvaK6EBSeDJgYSYpHCDFzh0JbynRO5W9zP0CbobeVvlUEJKeM80ZwoEjNGcQzpDFTlVWbSIsb4rKkxKB4Sers= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from [10.0.3.15] (95.79.108.179) by BN3PR0701MB1656.namprd07.prod.outlook.com (2a01:111:e400:58f2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Thu, 10 May 2018 15:36:31 +0000 Subject: Re: [PATCH][next] net: aquantia: fix unsigned numvecs comparison with less than zero To: Colin King , "David S . Miller" , Pavel Belous , Wei Yongjun , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180510125201.19707-1-colin.king@canonical.com> From: Igor Russkikh Message-ID: Date: Thu, 10 May 2018 18:36:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180510125201.19707-1-colin.king@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [95.79.108.179] X-ClientProxiedBy: AM0PR0102CA0064.eurprd01.prod.exchangelabs.com (2603:10a6:208::41) To BN3PR0701MB1656.namprd07.prod.outlook.com (2a01:111:e400:58f2::19) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020);SRVR:BN3PR0701MB1656; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1656;3:+i1H23MsXiDfk8Jx2Ud8+atCV/bnjNNkK2z4zxFvZDBPNRjL+Ya9Unf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IhBv8bIDNYy0/n8DRRXcH8ia8x5RIOjEsYG9YU7fE4lF8HnM3cJo6zVtCdwdJcEyPPu4iKVgaNtaba8dVylR2Yn82h2uBA4Fxszl9p4vkIZJNpTBGBkkxjboYL9z4HRwzBwJ55LsaqInenwpnHr/27sSPzQ+YFR1rmv3c1AvN9tn+BbtwiPcD6oxEZ+10g/dYM17jC/zsHUoUWFt7lLtpmePFnAR0eiNhELkLsZcTSfUlt72pNsMOI5r7s+bonB4wIE8SPuIZ5ctD2TC88LNtr0wE1eaynEyD5JHEewN;4:QEXjLVzdwevyuPnwN2R0JgPS7ySO4lRFL5WSzYVe1Eu6zF1cWOfJ6xXMKuSZY1zjO4UFwiSd9CKd/F1DBX+RNSbiDRXFo2HaACbfvOWVLUvXMND6vJDUecgGzdnzVLR+XlAAm3pZV7/W7dD1wt28221Q2TmqoJfLLtlyzMFFeP+zHTQwGGLhpo5+tYZ92OANdZ0us43Y3gK9sa6Yj+hQBofG+0INTrFHkVMyK8ToDpRIjBewDcu6hwJ45ZXWJ+PsGHxo3sd8jqawQMJ10WwLjxPfJ/WUPzP2HW9Q4N04vJ3qlre7cM5x611CrGJRDOX/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(198206253151910); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123564045)(2016111802025)(20161123558120)(6043046)(6072148)(201708071742011);SRVR:BN3PR0701MB1656;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1656; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(39850400004)(376002)(346002)(396003)(366004)(39380400002)(189003)(199004)(16576012)(110136005)(58126008)(316002)(53936002)(31696002)(86362001)(2906002)(50466002)(6666003)(72206003)(105586002)(31686004)(36756003)(106356001)(6486002)(229853002)(68736007)(3846002)(6116002)(230700001)(65826007)(64126003)(478600001)(59450400001)(25786009)(7736002)(76176011)(305945005)(23676004)(52146003)(2486003)(446003)(8676002)(186003)(52116002)(16526019)(26005)(8936002)(486006)(47776003)(77096007)(6246003)(956004)(65806001)(65956001)(4326008)(81156014)(81166006)(5660300001)(44832011)(2616005)(66066001)(476003)(386003)(97736004)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1656;H:[10.0.3.15];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjA3MDFNQjE2NTY7MjM6ZUVaUGNCZUR0RlFmMmN4cFNCbENuVFZj?= =?utf-8?B?TENYR0poQU5ZSlVJVU10UU15Q1JrMFBxd00yUDBiVjlqZ3J6SC9XWjFuRXJW?= =?utf-8?B?Zks2QU04WFMra0ZXdllQNUMzd2Q2QU5KNncxbElZMXRoZTdWdzJ5by9BVExx?= =?utf-8?B?MTBTL0NlVzkvSDFKV3JLM2hLOG1aQkxQQWZIbE1RcTVnclFaYUJJSU1iN1c5?= =?utf-8?B?c2JsdytoZGVCaGZDam9tVjBkTUU4V0pDc2hKS0hWMjRFRW5jRmNNQzVicm1C?= =?utf-8?B?SklJMWVnMVE4RDFKRWtMWUY3QVp4aDFCY0xIU25RcjVXbFdnQ3FoZFpwcGNN?= =?utf-8?B?YVBVTEVoV3liRi91TGpGb1ppY3N6VWlLNllkQ0djYkpiNmMvOEJITjRzd2FK?= =?utf-8?B?RDB3Tnk5enM0Z3M5VnUxc3ZZOWx4NzRuYmNjbDNzeUlOV3dBeENLUzNtVk9k?= =?utf-8?B?endCZkxncUZrSzN1UDJuOWM4VHF1TTZjUXhoaEJteGFRSEpBZmVMTlRSNTlW?= =?utf-8?B?Y1loRzRYUVlFanBSblBGNU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OEe6Rf1Rs83J/6aLn9VMx3Autp3wjMjWuglZ2ZE6p4RrSkGvtPUUVab00eVbAQ9TjLgx7IwPlvZPcgDEfByjhp4Ns51iDIGXpd4H9KIaR+0cf0zpr2Ifp03+lmBooesb9Nan5SqkIzqNm1RxoKznMZPxuprCUflDdeIZ26dMTEj+8sEr4nVnmIwR29oAT0geQlgKyYAnuzaDQ4o1wPiVwUuziSMtSnJLgVGt+v8d6pJD3pcZ2jbYGtJZCgpeaOEi/np/zm8lFmqzU/crfGPd/YRi+dd0Vt711lqfRJA==;5:hqteAytmH7l/8LyHpfSXf9qk5JuNcCEh4YnOm6yAem8ZD0vptvaB3Xymq2wSzCjKFYY6PfkC8L0Ztz++MpiGdHs0Cdn+dGBuaUEMLlCssr1N0kxIMDVLgoSJPkvMtdvIFxYE+ZFmS/dWmffn0aWTfhcRn2pFJOWs12fKKLY0DDo=;24:kraEJ05FT2Tt8qiCtlTRQOlX2vFzDW4wVqFE810w/urTrF4/XXWBdqkdp013/vKo8eAfQ0lTZtn75vmHdKnU0d3WSEaGzCsJl3lEU458Cfo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1656;7:ZgZJSETXe2WwL47LzhLsJqposNtSvpSgDT2L1MtfKoMRoDU3k27Y15Zl3/yk92inCL8CA0LSgs97DmN0efu/TFimUMvwIBxlojHcJ9uMpVS9UIJXAVKobn0IVsMpayrAsyrJ4eRP4wq5gyidfQ5+HO+ONUUBeuqA3fqFXpTQjs1rxR9hOBp92WZclVmU+HXEKVKmhWnNYcbecrMJz1uTkljLqfNc2TVxxt1p+7RahOLADW5C5iJ3SIGKGbzrIds9 X-MS-Office365-Filtering-Correlation-Id: a760bd33-4f43-4b39-028a-08d5b68bcedf X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 15:36:31.3504 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a760bd33-4f43-4b39-028a-08d5b68bcedf X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1656 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks, Colin! > 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 > --- Acked-by: Igor Russkikh