Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6141858rdb; Mon, 1 Jan 2024 10:12:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+imI4SlF6adGvs0mb34vHO6KgO4q29ARaPz3CT5SKdur3K+cRD4nzBDIOajjUGnOWUmqi X-Received: by 2002:a50:c10a:0:b0:554:a164:f0bd with SMTP id l10-20020a50c10a000000b00554a164f0bdmr5832102edf.141.1704132756435; Mon, 01 Jan 2024 10:12:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704132756; cv=none; d=google.com; s=arc-20160816; b=olhTEht3GqRyzEccrFo8//K5Sb2XDLWBuBk9VEU0eRYS+GI9eXv+tXbMhP59FPwfU6 35nu7x/13/eFPJer/Mku7szyjFHlqT7Y9x1p22Qk0WlYnI/2y67Exh2jyP6VmNZjhkiO WRGHg+LD+F3U2ODSUjDQS9PTqwh+M+MhoImFPZTs/nTxZfEfEw12JuMsEREu8dLd2dUc 6HNipyuQSNXo575Hca31gBY7LC6IGX03cdt6CA362PmiD2G9Gt76z+qYnJD1RGzJh6C7 ge1kDlWDTIDLiG49GRU5TlYkSxxjUu9hjy0mi007zXZp/lT6kfPZgNNDGtKtPZneIVBL hQqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Yfcinmzu3fGAHYO60etHbYExmH51CIjL4/eAucUWHkA=; fh=oyQFNTpWqIAD709lm8cMw9sUjeXAALmRKV/QoLhlwHg=; b=u80aCKv2ICoNtZME3IbH3/dWcKaBpyOHb0oq+Wy6T56E2415I0HCaNAoQ9m2DAbACv QxXdIBKLTrLzK30lkroZ85ZXaJlP1io+s52Mc7zBN4dmrJmwxxImpBwo1tfM99l94YwM pnaaMxMqN2tmqwnxM4IMAFoiSMuE2gAabyv6LG80PzfF9OZbQO4HvZtVRIYWHZdgmhpz b54dXqItUSwrwtyn1Lov2T2ve4d9psosLSI8qD6+4SOWH/Aoi2lKxdORdTzADBnR/Xlg 7rxldgfwRmEWJ3DCijdaM6jrN42/+gG7wyzNFZnrZcfG6hOHoILR4x0qTJ2XRymMHzO4 XxyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20230601.gappssmtp.com header.s=20230601 header.b=Les3QTOH; spf=pass (google.com: domain of linux-kernel+bounces-13924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=networkplumber.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y3-20020a056402358300b005554ae2483bsi5093398edc.564.2024.01.01.10.12.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 10:12:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20230601.gappssmtp.com header.s=20230601 header.b=Les3QTOH; spf=pass (google.com: domain of linux-kernel+bounces-13924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=networkplumber.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 30B111F215C7 for ; Mon, 1 Jan 2024 18:12:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1833BC2C0; Mon, 1 Jan 2024 18:12:27 +0000 (UTC) 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" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 CCA2ABA3C 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 Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6d9af1f52bcso1901081b3a.3 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=B4+MD5Mzj6T/ZiZHPbtJyPjiQeqHG9+94CuTtBydFGn2SqWyT9mgbBHlWUhvOxe/ey 9YzK9K3QGKnY9m7MNoU82cQpBzQ2IHVHDVa6oF0ZPodC2JkpzNfppBzy140zDv4Cko8t 1RQgS4WeL2rt0+EPB5zAufZXe/bTBi0j3cXGuN9X6CY3XzypPftbfUhGuQJLthOozFOF +4HXLRWidvxkAR3J5veWW+9BynoVJ3aJEY/6QK+RJekdj43burgcnd5AJbikspk0DfnM CwX0pXAOfBhIiE3xNDs13AcXY/1/LHZ6DkwOzkuEUPCPaAuiBVjlKgl3S2w+YBO/EO2a SvJA== X-Gm-Message-State: AOJu0Yw0iCOMSDhtjYQljIepnoOjKh0rkvtTvHKgTlrJBY+Nrc3fiMNG 6GkxN756MQITswZnZOyMv73Wmb/oqx7Shg== 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: linux-kernel@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.