From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CB13C433FE for ; Fri, 4 Nov 2022 19:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229517AbiKDT0J (ORCPT ); Fri, 4 Nov 2022 15:26:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiKDT0G (ORCPT ); Fri, 4 Nov 2022 15:26:06 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BE5F2ADD for ; Fri, 4 Nov 2022 12:26:05 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id s196so5193029pgs.3 for ; Fri, 04 Nov 2022 12:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :from:to:cc:subject:date:message-id:reply-to; bh=ytLIhKZuYdmh84oUVdzM6+Xt1URUXrJYojk/wKNfrD8=; b=O+tMUcOtLUO27foXcasLA7fBSvjCJZGLiylgapTnNf+R617vScp8qdh672FH/pq5zD j0hL6YPGSsYuAZoaqzebFkEkndKOT1MhyYcL6iFHjuWmCGwP4w3vGyJlG9Q0+4H7M1rx lju2sCW+AdCH3dasrSOBNaahaBnnyHEisA/Yw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ytLIhKZuYdmh84oUVdzM6+Xt1URUXrJYojk/wKNfrD8=; b=pfEU6+FQJC1zAMGGMtEPrUAE4Nn4emGw+RK3pNUtrYFd3WItqjfafSuifGaZbT3jHy Fg+ZE/ZG9xPw0j0003zpWF7k9tJUUeiK3XjdMgpeRuKBRs65wcdnZxdNxtOlNClKXzxc I2k0uKsWzNpZ84onQFCx1eDnYKxhuppY/cAtcoOz9fDRk35xju3dwxBx2bHeh7qg8JuI nOjU+4Od05h29NGLVyb3GXat9bplb3nRn30ZqmM5ZACB+gzu2o8PhcrK4Wvk4CYS/Qf0 H5UXCDRYEK34EpJ9E/pOoAq9+CPSs1oKKuspujlirC9jiiXMM3UWRBmHOpdagReu1w19 eXlg== X-Gm-Message-State: ACrzQf1luA4okDi+eTPAta7h/Fs1oUQNmrv5fvVaeyNbykXq2P5oaslU MUX/8SmwALQ4fBp8fozw25qWYQ== X-Google-Smtp-Source: AMsMyM4puBHy4Rz/W6PItnEMR/7sY4Ht+hZTcYiZeHp4JNp/zgQEonPnvSrDu9FZgasYBNB+TeWwvw== X-Received: by 2002:a63:3182:0:b0:46f:ed32:54a6 with SMTP id x124-20020a633182000000b0046fed3254a6mr17225891pgx.69.1667589941673; Fri, 04 Nov 2022 12:25:41 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w128-20020a626286000000b0056ca3569a66sm3045377pfb.129.2022.11.04.12.25.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 12:25:41 -0700 (PDT) From: coverity-bot X-Google-Original-From: coverity-bot Date: Fri, 4 Nov 2022 12:25:40 -0700 To: Jiawen Wu Cc: Jakub Kicinski , Paolo Abeni , Christophe JAILLET , Mengyuan Lou , "David S. Miller" , Eric Dumazet , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Coverity: txgbe_calc_eeprom_checksum(): Control flow issues Message-ID: <202211041225.FF75B11482@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! This is an experimental semi-automated report about issues detected by Coverity from a scan of next-20221104 as part of the linux-next scan project: https://scan.coverity.com/projects/linux-next-weekly-scan You're getting this email because you were associated with the identified lines of code (noted below) that were touched by commits: Wed Nov 2 12:31:23 2022 +0000 049fe5365324 ("net: txgbe: Add operations to interact with firmware") Coverity reported the following: *** CID 1527152: Control flow issues (NO_EFFECT) drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c:200 in txgbe_calc_eeprom_checksum() 194 195 for (i = 0; i < TXGBE_EEPROM_LAST_WORD; i++) 196 if (i != wxhw->eeprom.sw_region_offset + TXGBE_EEPROM_CHECKSUM) 197 *checksum += local_buffer[i]; 198 199 *checksum = TXGBE_EEPROM_SUM - *checksum; vvv CID 1527152: Control flow issues (NO_EFFECT) vvv This less-than-zero comparison of an unsigned value is never true. "*checksum < 0". 200 if (*checksum < 0) 201 return -EINVAL; 202 203 if (eeprom_ptrs) 204 kvfree(eeprom_ptrs); 205 If this is a false positive, please let us know so we can mark it as such, or teach the Coverity rules to be smarter. If not, please make sure fixes get into linux-next. :) For patches fixing this, please include these lines (but double-check the "Fixes" first): Reported-by: coverity-bot Addresses-Coverity-ID: 1527152 ("Control flow issues") Fixes: 049fe5365324 ("net: txgbe: Add operations to interact with firmware") Thanks for your attention! -- Coverity-bot