From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (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 7535841F5DF for ; Thu, 16 Jul 2026 13:30:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784208635; cv=none; b=lEddD/eG1JGqhugIJ0M4C4zqmNEHR9Uonec9tlIqrXps0fWGA+mUJU0L0L8iz4XGDGA6BzYZPmfU1DM0ygZzCawk+4byDsbvEKZGu02FlI/t/DIjpOw0/J/tspWc6lbkJxz9ncVAOz/bZF7TseaFupB9qEVH7hKHDLivl7D1N5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784208635; c=relaxed/simple; bh=WB6mu1i3NewQ+i2LFqeE0E/NcGweHadEcPFk8ntwrEc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A/gGbOPs2fN9ALykcO6m87NMGSWaiVBK0N5WL/Sg3i7W/1xznB0rRVES2T6o3YeZjN0qDcmwlzSFpKxMfI5Y40r8yTTDuK/k+hJEyjPoTTRmyMng5h7WAPw2MkOXDyUpmXbWr0iTbdT5pxGMizjIPnZ2Wjnb9uKz/MU1WT1+q6w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=oizErKJs; arc=none smtp.client-ip=209.85.161.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oizErKJs" Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-6a375ba035eso1811167eaf.3 for ; Thu, 16 Jul 2026 06:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784208633; x=1784813433; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=f7TYuXzoNqDH2nR/xpl074QpxuDI0hlYBZ5yt21l508=; b=oizErKJsj4adiBXTxWdWxGvJBWd7U6JVhwAKQtsC4fiHw3XSyc84Pv8fnIXjju3gW0 LFY1b7NUjo4aAfUr9Gzge24YquM8EJYwge+0VG5H6mpolijVV+dgcc1qnlSekni33j76 1/pkb0s7oPsHJFiVOp/wot+ewVF/OjWL0q8/C23tPa5qAKc1i2kecqkTP1ecJffpRnWn VwHhLSc3JuZ4D3ZuTQGHoMavbwELFF3450Gk8W5qskMA38qXTd6nVBpyRC3M6wQLavTC qv1wPWn93CK8lZmZMeyGy4KBOqWR6d6XTs5a78nUoK0chcgQy2yP58A3yUCfkp7r6HJw m/QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784208633; x=1784813433; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=f7TYuXzoNqDH2nR/xpl074QpxuDI0hlYBZ5yt21l508=; b=aAqa65QVVQsWFo1VI6/3o0adCwRZ0JotJ7XZrVvqvs2GSOG9LaxbqZepcMFVyOHguw 1BgTuMSIGGbu+1URUQd3/LhVVUhH+CAZZ/5bTYG2SG3jM8tZMK5G6lG7N0XJtmwCVHWo W2pJIc+YWYE4nHehL6Hdm+lk6eYO0SCH/OD952Qixg5fduFNanx5Q/wiK5JG7DjfKDRv AIE6o0P0xTpDqz07AfBgtxyFKla3Z04KyjLuq/4rRoBXu6RJKIfHPnZ14w6dKsaPN06N gH8c2eNvnnBL9mU6/8wf7PkJxd6BYHap49RHG67/HaVBQPqjXplcKc54Sa3Up5k3dXnt nOAw== X-Forwarded-Encrypted: i=1; AHgh+RqCQBw5lA35fhwoa/f2hWLqRj2PApm5iPM1RAcsc6udltUu5FYSqAnvV3qornxUcm5lP+EIjUDo3GKb8/E=@vger.kernel.org X-Gm-Message-State: AOJu0YyuNVZcZJWQ7pB2EdEIb6NSsupEWhdWjpkfUrdiBbkIgok3fghw CW6QUZdHZzBkOk8v4Bv8nSN8hl2+vlAOL4NHaV9zJo4Ua3cKmx+tGSNn X-Gm-Gg: AfdE7cmmWCNO1SzlU6xVpwIz/YRmTLjmQAHgCrzu6Is4KRRh/CLOcOWlUgwwgcnywZy //tuD57H3fkQDE3AMkc75pjSZ7Ku37xuGmKU1puSWiphQ0KU+nbAZjNmm16Lk8j9nqPLNCeo3mo 4Q1kkyI/xmFMrK/SGiXXd+tejAk0OcZJH476Hkk1499TghND8+7IVp4xY9UmJlzfZV6O5fYKKhY jwUJP34+/xL1S2/L4F7uBrEBWuKs5uhlN4H2WWGE8vMc4nThfGo9wOz552dgoOVZSLsxpkSNALA eHv6tD8wM3kV+7eU5Uk7t/qBwMT+lh2SDAHEhkb8X9HPvwhoGP4dzvKlePcP++ZC/WhkXO+QSxJ l4mzsg90GOMaSIcV2C6xJx0ckTWMoWBNmsneVT0jg9QrS8m/60edIv8/b7BZvWDYuNNbgPEp/JY i1O7YZ X-Received: by 2002:a05:6820:1508:b0:6a2:e7df:c4ea with SMTP id 006d021491bc7-6a39a85a39cmr12923260eaf.65.1784208633146; Thu, 16 Jul 2026 06:30:33 -0700 (PDT) Received: from localhost ([74.80.182.90]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6a36a83ecc4sm16678950eaf.11.2026.07.16.06.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 06:30:32 -0700 (PDT) Date: Thu, 16 Jul 2026 16:30:25 +0300 From: Dan Carpenter To: Markus Elfring Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , MD Danish Anwar , Michael Grzeschik , Paolo Abeni , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Vadim Fedorenko , Yibo Dong , LKML , Jonathan Corbet Subject: Re: net: rnpgbe: Pass an expression directly in rnpgbe_rm_adapter() Message-ID: References: <7958e26e-a4f9-48ee-8d79-3797016944c5@web.de> <8110bb3f-70d9-4f0f-82f2-ffe1262b2962@web.de> <320cb00c-28f8-4871-9ec5-d9b86cca8bc9@web.de> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <320cb00c-28f8-4871-9ec5-d9b86cca8bc9@web.de> On Thu, Jul 16, 2026 at 10:20:42AM +0200, Markus Elfring wrote: > >>>> The address of a data structure member was determined before > >>>> a corresponding null pointer check in the implementation of > >>>> the function “rnpgbe_rm_adapter”. > >>>> > >>>> Thus avoid the risk for undefined behaviour by omitting the variable “hw”. > >>>> Pass the required address directly to a function call. > >>>> > >>>> This issue was detected by using the Coccinelle software. > >>>> > >>>> Fixes: 2ee95ec17e97c58b65e978a08b75fa8cb6424e4e ("net: rnpgbe: Add register_netdev") > >>> > >>> There is no NULL dereference here. It's just pointer math. > >>> No need for a Fixes tag. > >> > >> How does your view fit to information in an article like “Fun with NULL pointers, part 1” > >> (by Jonathan Corbet from 2009-07-20)?>> https://lwn.net/Articles/342330/ > >> > > > > Of course you can't have NULL pointer dereferences but this is not a > > dereference, it's just pointer math. > Does your understanding of programming language details differ from the view > by Jonathan Corbet? Jonathan Corbet's article talks about dereferences. p = tun->sk; ^^^^^^^ This is a dereference. p = &tun->sk; ^ This is pointer math. It's not a dereference. regards, dan carpenter