public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Fabio Baltieri'" <fabio.baltieri@gmail.com>,
	"'Mengyuan Lou'" <mengyuanlou@net-swift.com>,
	"'Andrew Lunn'" <andrew+netdev@lunn.ch>,
	"'David S. Miller'" <davem@davemloft.net>,
	"'Eric Dumazet'" <edumazet@google.com>,
	"'Jakub Kicinski'" <kuba@kernel.org>,
	"'Paolo Abeni'" <pabeni@redhat.com>,
	"'Simon Horman'" <horms@kernel.org>,
	"'Mengyuan Lou'" <mengyuanlou@net-swift.com>,
	"'Andrew Lunn'" <andrew+netdev@lunn.ch>,
	"'David S. Miller'" <davem@davemloft.net>,
	"'Eric Dumazet'" <edumazet@google.com>,
	"'Jakub Kicinski'" <kuba@kernel.org>,
	"'Paolo Abeni'" <pabeni@redhat.com>,
	"'Simon Horman'" <horms@kernel.org>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] net: txgbe: leave space for null terminators on property_entry
Date: Wed, 8 Apr 2026 15:40:00 +0800	[thread overview]
Message-ID: <09aa01dcc72a$e7bb2df0$b73189d0$@trustnetic.com> (raw)
In-Reply-To: <20260405222013.5347-1-fabio.baltieri@gmail.com>

> Lists of struct property_entry are supposed to be terminated with an
> empty property, this driver currently seems to be allocating exactly the
> amount of entry used.
> 
> Change the struct definition to leave an extra element for all
> property_entry.
> 
> Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
> ---
> 
> Hi, bumped into this while studying the code, looks like the struct has
> been allocated without space for terminators, guess the top ones just
> end up using the bottom props as well but I'm surprised this does not
> crash at some point. Build test only, don't have any hardware for this,
> let me know if I'm missing something here.
> 
> Cheers,
> Fabio
> 
>  drivers/net/ethernet/wangxun/txgbe/txgbe_type.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h b/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h
> index 82433e9cb0e3..6b05f32b4a01 100644
> --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h
> +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h
> @@ -424,10 +424,10 @@ struct txgbe_nodes {
>  	char i2c_name[32];
>  	char sfp_name[32];
>  	char phylink_name[32];
> -	struct property_entry gpio_props[1];
> -	struct property_entry i2c_props[3];
> -	struct property_entry sfp_props[8];
> -	struct property_entry phylink_props[2];
> +	struct property_entry gpio_props[2];
> +	struct property_entry i2c_props[4];
> +	struct property_entry sfp_props[9];
> +	struct property_entry phylink_props[3];
>  	struct software_node_ref_args i2c_ref[1];
>  	struct software_node_ref_args gpio0_ref[1];
>  	struct software_node_ref_args gpio1_ref[1];
> --
> 2.47.3

Tested-by: Jiawen Wu <jiawenwu@trustnetic.com>



      reply	other threads:[~2026-04-08  7:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-05 22:20 [PATCH] net: txgbe: leave space for null terminators on property_entry Fabio Baltieri
2026-04-08  7:40 ` Jiawen Wu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='09aa01dcc72a$e7bb2df0$b73189d0$@trustnetic.com' \
    --to=jiawenwu@trustnetic.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fabio.baltieri@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox