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 23BE2C433EF for ; Thu, 30 Dec 2021 12:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239033AbhL3MMj convert rfc822-to-8bit (ORCPT ); Thu, 30 Dec 2021 07:12:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbhL3MMi (ORCPT ); Thu, 30 Dec 2021 07:12:38 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F948C061574; Thu, 30 Dec 2021 04:12:38 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1n2uIE-0006VY-Cx; Thu, 30 Dec 2021 13:12:26 +0100 Date: Thu, 30 Dec 2021 13:12:26 +0100 From: Florian Westphal To: cgel.zte@gmail.com Cc: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org, luo penghao , Zeal Robot Subject: Re: [PATCH linux] netfilter: Remove unnecessary ret assignment Message-ID: <20211230121226.GC21386@breakpoint.cc> References: <20211230063143.586220-1-luo.penghao@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20211230063143.586220-1-luo.penghao@zte.com.cn> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cgel.zte@gmail.com wrote: > From: luo penghao > > Regardless of whether the subsequent (copy_to_user(user, &info, *len) != 0) > holds, the value of ret will be assigned a new value. > > The clang_analyzer complains as follows: > > net/ipv6/netfilter/ip6_tables.c: > > Value stored to 'ret' is never read Please fix this properly: 1. consider adding error unwinding instead. 2. net/ipv4/netfilter/ip_tables.c has same construct