All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Cc: Jose Abreu <Jose.Abreu@synopsys.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net-next 1/1] net: pcs: xpcs: fix error handling on failed to allocate memory
Date: Wed, 11 Aug 2021 14:47:24 +0300	[thread overview]
Message-ID: <20210811114724.nr6qza3n7nknh7ew@skbuf> (raw)
In-Reply-To: <20210810085812.1808466-1-vee.khee.wong@linux.intel.com>

On Tue, Aug 10, 2021 at 04:58:12PM +0800, Wong Vee Khee wrote:
> Drivers such as sja1105 and stmmac that call xpcs_create() expects an
> error returned by the pcs-xpcs module, but this was not the case on
> failed to allocate memory.
> 
> Fixed this by returning an -ENOMEM instead of a NULL pointer.
> 
> Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
> Signed-off-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
> ---
>  drivers/net/pcs/pcs-xpcs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
> index 63fda3fc40aa..4bd61339823c 100644
> --- a/drivers/net/pcs/pcs-xpcs.c
> +++ b/drivers/net/pcs/pcs-xpcs.c
> @@ -1089,7 +1089,7 @@ struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
>  
>  	xpcs = kzalloc(sizeof(*xpcs), GFP_KERNEL);
>  	if (!xpcs)
> -		return NULL;
> +		return ERR_PTR(-ENOMEM);
>  
>  	xpcs->mdiodev = mdiodev;
>  
> -- 
> 2.25.1
> 

I know I changed my mind, but seeing that Intel's Alder Lake S patches
are likely going to stall for a while due to ungoing design discussions:
https://patchwork.kernel.org/project/netdevbpf/patch/20210809102229.933748-2-vee.khee.wong@linux.intel.com/
the net -> net-next merge might not be so far in the future after all.

So could this patch be applied to the "net" tree after all? According to
the cadence of the last 2 net -> net-next merges, which were on Jul 31
and Aug 5, the next one should be soon-ish.

The patch is fine:

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Fixes: 3ad1d171548e ("net: dsa: sja1105: migrate to xpcs for SGMII")

  reply	other threads:[~2021-08-11 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10  8:58 [PATCH net-next 1/1] net: pcs: xpcs: fix error handling on failed to allocate memory Wong Vee Khee
2021-08-11 11:47 ` Vladimir Oltean [this message]
2021-08-11 22:10 ` patchwork-bot+netdevbpf

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=20210811114724.nr6qza3n7nknh7ew@skbuf \
    --to=olteanv@gmail.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=vee.khee.wong@linux.intel.com \
    --cc=vladimir.oltean@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.