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 2AB63C54EE9 for ; Tue, 20 Sep 2022 19:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231415AbiITTlz (ORCPT ); Tue, 20 Sep 2022 15:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbiITTlx (ORCPT ); Tue, 20 Sep 2022 15:41:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDAA4501B0; Tue, 20 Sep 2022 12:41:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 69F66B82CA4; Tue, 20 Sep 2022 19:41:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7D6DC433D6; Tue, 20 Sep 2022 19:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663702910; bh=2IRKjLcjE85iUZpYctlQlYqRSRVbXGHAuv3E3ZjSaUI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VHafld0cxlOe8SCBUQ/TNA0wE9aAHKjyh6c/Ih9QLDgi3D5Naf2p5qGjabdzS7lyQ oITFhdFfNh1VQUXxIoa1iSebpCIxiwxbVtsoJycvckGBLuyJTFNXKdDaQB4ppwXLdm OfqeC+tXn69tUZhaut11zlP9P3dz0WhzlUhak1j0KUnflAa+cDqulKRfiEI6rfBZNe SH+bUOsszq2yiWtV7DL8lbYW3LgwHx2x+zkLxxWImFG2PAXI6ftnzu/VMPdNHjS6/C 7AfTm2oZzuGoqh29pJ3dsLGjQvVP3Ae24y0/MxOty/mAbUJW+a57aZ3lhehfAV0YSO 9jl/83xpihivA== Date: Tue, 20 Sep 2022 12:41:48 -0700 From: Jakub Kicinski To: Li Zhong Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, edumazet@google.com, davem@davemloft.net Subject: Re: [PATCH v1] net/ethtool/tunnels: check the return value of nla_nest_start() Message-ID: <20220920124148.58e8aab5@kernel.org> In-Reply-To: References: <20220917022602.3843619-1-floridsleeves@gmail.com> <20220920113744.64b16924@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 20 Sep 2022 12:31:29 -0700 Li Zhong wrote: > On Tue, Sep 20, 2022 at 11:37 AM Jakub Kicinski wrote: > > On Fri, 16 Sep 2022 19:26:02 -0700 Li Zhong wrote: > > > goto err_cancel_table; > > > > > > entry = nla_nest_start(skb, ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY); > > > + if (!entry) > > > + return -EMSGSIZE; > > > > not even correct, and completely harmless > > Thanks for your reply. Maybe a more suitable way of error handling is 'goto > err_cancel_table;'? Yes, but you _most_ provide the detailed analysis of the impact in the commit message for the patches to be considered for merging.