Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1623791rwl; Fri, 24 Mar 2023 13:09:03 -0700 (PDT) X-Google-Smtp-Source: AK7set/hww453+kGE51RfvWaRmg6/OfcuiINEwVBWrlr5Bp/oNhscd5PKWCDDlblJJ9xqBb+WV9F X-Received: by 2002:a05:6a20:b55d:b0:d5:8a5:e618 with SMTP id ev29-20020a056a20b55d00b000d508a5e618mr2999015pzb.41.1679688543576; Fri, 24 Mar 2023 13:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679688543; cv=none; d=google.com; s=arc-20160816; b=FO1kO8vPknwhaM/v/kRVhcG+K/6EJ6vISHyFAo0rLdwRH1jqYkaXbYrMEnWEKK5iY2 c9aerT4JN/f3Ven23Ye7liZiVU5dalZW0nXJVIZoTsaMyWDzPhA2111EK4RV280AGZfP D1Mto4uqFfnbUARRqKkpERxGZhiH+Yq5Zm15gi/tYkqqSRU0RNHdns9LuG5FzhtI8k6P ysnXrWVgbkrliX6nCdaBtB6yubF4RWsey+nUToP8BLc+d6hXNhryRBhBcHk9W9XxCBHp 6JgaYnf94TO9nCI2fQ6ltd1C41AiIrRv1XeDwj1arv+e7GScY9sw+6XUZ0HK69cphQzt 9cgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vwDdbXQ+Kq3hsMLWwf0D7a7P6qWxTGqxL0bP6Pa+IhM=; b=LFZWvhoSkRfXZHwg3i5RabrV+HsqQBZzpdR6F8XznneHXLUiAuBDgPtegqnzFqihPx FFcmoziPvT1iNKC/FaKurdtCEX1gOYugU2Y9U7+do8QqeK6xA04j0BUoNxVU+4OSj+4H P8bI8APsQvt4h3YtcAYBvnanfhC6dHABZfTHDZsNiTV3XHP+QJ82qePBDUGeO8t/HdHc jMnsZvfg36RtuMnoHB++lyGjr/WffbJSFKw5MU3cWJXEs6xiYoUdZUGrGkUm2P8AiK/X o44QtaXAAgm7swL3vgJP68jRVQpk7CrK4UYuG7jzLWEX5ggzsev7UYxmxc0GmSwwFJ+5 Z7Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=J+UaawPi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j70-20020a638b49000000b0050faad0977dsi10808097pge.594.2023.03.24.13.08.27; Fri, 24 Mar 2023 13:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=J+UaawPi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231920AbjCXUIC (ORCPT + 99 others); Fri, 24 Mar 2023 16:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbjCXUIA (ORCPT ); Fri, 24 Mar 2023 16:08:00 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48F21B445; Fri, 24 Mar 2023 13:07:59 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id x3so12203306edb.10; Fri, 24 Mar 2023 13:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679688478; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vwDdbXQ+Kq3hsMLWwf0D7a7P6qWxTGqxL0bP6Pa+IhM=; b=J+UaawPiJmMi7uhnTrF9yyvXI4oPYzXk+B7f7zlP7Z/XjkkNGDNM7O/BIVrKXqnMLB oMHpezXAsxorxYJBpIePgj72FfEEGK5dEJTmgoGI0zwRl9lMxPaglrNH/GBjhNkA/d09 wY6eZRGiq5A8Ihmhqssqo4xt7BMiEu24az3eZ1/JmgJMT48nvdzMpVSQUUZ8mV4U1Imh JMwbHhESbUAYPZ/rL9mHbE+Fskv/X0hBE4OKpYjaUr+v7QoYO39GvuY5y/KAGlvBmPp+ G4yi4YCiu0eAw9x3A4l9tcCF0ZgLzxumrQ9YlRyTe23cUOpJoZy+D6daNjaNyejPTFp5 KiAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679688478; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vwDdbXQ+Kq3hsMLWwf0D7a7P6qWxTGqxL0bP6Pa+IhM=; b=zHINZTiuUc6yCf0J/bmXwlTkH1dNMFMWZRdhIWz2HmIHlOkulqJCNTiMR0wpUUn+db UGM0Bmlkgpix6N6RCIcJgL69HMhnenMrV2w8Y9pTuhGH8VY2YPUWG0mKNUP9pCCSEkDt ByOrJL0QjzlYnx4ybc+dhm+j/KftfszxCPuiEEGrH/oKajgrcRUaGW4cb3a1Sbl9inO8 Y8DA5Ay0ldVtOpCrnrq4ibIli0okiww7dCx+3LnCRGGddcB17ZbBJhei/aYGvlmCgfV+ /oXpcmfOuFdt/4BzMOivhOUhiIiuyei+4XxkDDrMr4Df+0kdtMosTmyw+dezULuKr9uy HA9A== X-Gm-Message-State: AAQBX9cD60nqBr+c2AKtQk8r36k+8pDbvyY5+lqUiACcEE6l5bCJeOSw UWJVeWbDcBjkFbM8Kvd76KTAeBlLw9OSO+l/CPg= X-Received: by 2002:a17:906:ee89:b0:92e:a234:110a with SMTP id wt9-20020a170906ee8900b0092ea234110amr2060398ejb.3.1679688477723; Fri, 24 Mar 2023 13:07:57 -0700 (PDT) MIME-Version: 1.0 References: <9e0a7e6c-484d-92e0-ddf9-6e541403327e@web.de> In-Reply-To: <9e0a7e6c-484d-92e0-ddf9-6e541403327e@web.de> From: Alexei Starovoitov Date: Fri, 24 Mar 2023 13:07:46 -0700 Message-ID: Subject: Re: [PATCH] selftests/bpf: Improve exception handling in rbtree_add_and_remove() To: Markus Elfring Cc: kernel-janitors@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , bpf , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Dave Marchevsky , David Vernet , Hao Luo , Jiri Olsa , John Fastabend , KP Singh , Martin KaFai Lau , Mykola Lysenko , Shuah Khan , Song Liu , Stanislav Fomichev , Yonghong Song , cocci@inria.fr, LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 24, 2023 at 7:13=E2=80=AFAM Markus Elfring wrote: > > Date: Fri, 24 Mar 2023 14:54:18 +0100 > > The label =E2=80=9Cerr_out=E2=80=9D was used to jump to another pointer c= heck despite of > the detail in the implementation of the function =E2=80=9Crbtree_add_and_= remove=E2=80=9D > that it was determined already that a corresponding variable contained > a null pointer. > > 1. Thus return directly after the first call of the function > =E2=80=9Cbpf_obj_new=E2=80=9D failed. > > 2. Delete two questionable checks. > > 3. Omit an extra initialisation (for the variable =E2=80=9Cm=E2=80=9D) > which became unnecessary with this refactoring. > > > This issue was detected by using the Coccinelle software. > > Fixes: 215249f6adc0359e3546829e7ee622b5e309b0ad ("selftests/bpf: Add rbtr= ee selftests") > Signed-off-by: Markus Elfring Nack. Please stop sending such "cleanup" patches.