# Re: \[PATCH net\] net: rnpgbe: Pass an expression directly in rnpgbe\_rm\_adapter()

- From: Dan Carpenter \<hidden\>
- Date: 2026-07-13 08:04:53 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/07/17250025
- Thread: https://ratatoskr.run/netdev/2026/07/17248490/t.md

```text
On Sun, Jul 12, 2026 at 08:35:21PM +0200, Markus Elfring wrote:
> From: Markus Elfring <redacted>
> Date: Sun, 12 Jul 2026 20:25:10 +0200
> 
> 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.

regards,
dan carpenter

```
