From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6956BA3A for ; Mon, 1 Jan 2024 18:12:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20230601.gappssmtp.com header.i=@networkplumber-org.20230601.gappssmtp.com header.b="Les3QTOH" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6d9a79a1ad4so1959515b3a.2 for ; Mon, 01 Jan 2024 10:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1704132744; x=1704737544; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Yfcinmzu3fGAHYO60etHbYExmH51CIjL4/eAucUWHkA=; b=Les3QTOHWak7mFcH9qiRuvPciyV+VyctLxpjyx9kGtuM+8bLbvLlkC0GivJdgBZ9Lw p8nESOO4PTQYdNTmoXrSvxKr2xW+SCEByqzS6l3XzdD9oPZ6NXubwMGfGImwfXj3zF/v MmMt8Z3Em6YmZ25EW67Cjg5cDs+1LUPNRaEc+jplMfG2SKJ/RLWBTlEEtKTYjFeqlebG 9KCXrQx7M6lGhB3bnqVtl5IWpsibU/7HhhwDt5u1AsdGEMKpLcG9x56XSWC5PyHgiBVJ GWInuQsa9tpXTifrlkqsqvnwTR0ALXJUwV79WD1QTCiKiMg/05vTn1K2KdSauOwH1eAl 5WFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704132744; x=1704737544; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yfcinmzu3fGAHYO60etHbYExmH51CIjL4/eAucUWHkA=; b=q242aN+JPwn2ePc++kvKWJ7cN0pzf+2Z8+x9lg9WtxHtJpIP8qXzT0ED4XG3LF+MTD eDbtXWf91aDz8tzhK70n2H7oTHLl9UmbHktkdLdtrZkz6SqNQ02UOeBLIbceK4OB6Blb waslrAJKeO/WogzynGjD6KKtk1WQrOnRWZxvSyXXmWlulZzJU0Bb3Hi+WKJMOnuMpwjW nf/1o/s49MXEFjLTxnbX2EsTPz6dqBpwr9LKMMK7luwJYcsCkyl4fBYBb5e/QFRVQVBI 1lZ0q7dCEINW9XDzqAx3Y+IoYLo5aWhtAyVZGoxwJX/Y066L/ublWbaOj0IxiSKIy9Mn vbkQ== X-Gm-Message-State: AOJu0YyJCsRu7s4Iboo2NmZq/AXpXypdM2kc4KRjdl3ddRP8BZk2UkAr iNFoZWoQ+CpiMmlu3u5srLQC04zOEhn5xEazQIEYcjK9gYk= X-Google-Smtp-Source: AGHT+IHWr79IDfGUgn0Of4gsM+Z/TLPclGPF4NChQ8ZT1YIYFxNFQk6DXwGn7K/+2nGo///akLy5zw== X-Received: by 2002:a05:6a20:9185:b0:197:2f2d:acf1 with SMTP id v5-20020a056a20918500b001972f2dacf1mr158354pzd.10.1704132744068; Mon, 01 Jan 2024 10:12:24 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id n7-20020a170902e54700b001d0cd351baesm20338723plf.13.2024.01.01.10.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 10:12:23 -0800 (PST) Date: Mon, 1 Jan 2024 10:12:21 -0800 From: Stephen Hemminger To: Markus Elfring Cc: Willem de Bruijn , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , LKML Subject: Re: packet: Improve exception handling in fanout_add() Message-ID: <20240101101221.73276d5d@hermes.local> In-Reply-To: References: <828bb442-29d0-4bb8-b90d-f200bdd4faf6@web.de> <6591e0fcb089f_21410c2946c@willemb.c.googlers.com.notmuch> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, 1 Jan 2024 10:46:45 +0100 Markus Elfring wrote: > > It is fine to call kfree with a possible NULL pointer: =20 > =E2=80=A6 > > * If @object is NULL, no operation is performed. > > */ > > void kfree(const void *object) =20 >=20 > Such a function call triggers an input parameter validation > with a corresponding immediate return, doesn't it? > Do you find such data processing really helpful for the desired error/exc= eption handling? If you look at the existing coccinelle script there is even one to remove unnecessary checks for null before calling kfree.