From: Simon Horman <horms@kernel.org>
To: Dipendra Khadka <kdipendra88@gmail.com>
Cc: florian.fainelli@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
maxime.chevallier@bootlin.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net v5] net: systemport: Add error pointer checks in bcm_sysport_map_queues() and bcm_sysport_unmap_queues()
Date: Fri, 27 Sep 2024 12:02:36 +0100 [thread overview]
Message-ID: <20240927110236.GK4029621@kernel.org> (raw)
In-Reply-To: <20240926160513.7252-1-kdipendra88@gmail.com>
+ Vladimir
On Thu, Sep 26, 2024 at 04:05:12PM +0000, Dipendra Khadka wrote:
> Add error pointer checks in bcm_sysport_map_queues() and
> bcm_sysport_unmap_queues() after calling dsa_port_from_netdev().
>
> Fixes: 1593cd40d785 ("net: systemport: use standard netdevice notifier to detect DSA presence")
> Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
> ---
> v5:
> -Removed extra parentheses
> v4: https://lore.kernel.org/all/20240925152927.4579-1-kdipendra88@gmail.com/
> - Removed wrong and used correct Fixes: tag
> v3: https://lore.kernel.org/all/20240924185634.2358-1-kdipendra88@gmail.com/
> - Updated patch subject
> - Updated patch description
> - Added Fixes: tags
> - Fixed typo from PRT_ERR to PTR_ERR
> - Error is checked just after assignment
> v2: https://lore.kernel.org/all/20240923053900.1310-1-kdipendra88@gmail.com/
> - Change the subject of the patch to net
> v1: https://lore.kernel.org/all/20240922181739.50056-1-kdipendra88@gmail.com/
> drivers/net/ethernet/broadcom/bcmsysport.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
> index c9faa8540859..a7ad829f11d4 100644
> --- a/drivers/net/ethernet/broadcom/bcmsysport.c
> +++ b/drivers/net/ethernet/broadcom/bcmsysport.c
> @@ -2331,11 +2331,15 @@ static const struct net_device_ops bcm_sysport_netdev_ops = {
> static int bcm_sysport_map_queues(struct net_device *dev,
> struct net_device *slave_dev)
> {
> - struct dsa_port *dp = dsa_port_from_netdev(slave_dev);
> struct bcm_sysport_priv *priv = netdev_priv(dev);
> struct bcm_sysport_tx_ring *ring;
> unsigned int num_tx_queues;
> unsigned int q, qp, port;
> + struct dsa_port *dp;
> +
> + dp = dsa_port_from_netdev(slave_dev);
> + if (IS_ERR(dp))
> + return PTR_ERR(dp);
>
> /* We can't be setting up queue inspection for non directly attached
> * switches
> @@ -2386,11 +2390,15 @@ static int bcm_sysport_map_queues(struct net_device *dev,
> static int bcm_sysport_unmap_queues(struct net_device *dev,
> struct net_device *slave_dev)
> {
> - struct dsa_port *dp = dsa_port_from_netdev(slave_dev);
> struct bcm_sysport_priv *priv = netdev_priv(dev);
> struct bcm_sysport_tx_ring *ring;
> unsigned int num_tx_queues;
> unsigned int q, qp, port;
> + struct dsa_port *dp;
> +
> + dp = dsa_port_from_netdev(slave_dev);
> + if (IS_ERR(dp))
> + return PTR_ERR(dp);
>
> port = dp->index;
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2024-09-27 11:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-26 16:05 [PATCH net v5] net: systemport: Add error pointer checks in bcm_sysport_map_queues() and bcm_sysport_unmap_queues() Dipendra Khadka
2024-09-27 11:02 ` Simon Horman [this message]
2024-09-27 11:29 ` Vladimir Oltean
2024-09-27 12:00 ` Vladimir Oltean
2024-09-30 18:07 ` Dipendra Khadka
2024-09-30 20:32 ` Vladimir Oltean
2024-10-01 4:37 ` Dipendra Khadka
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=20240927110236.GK4029621@kernel.org \
--to=horms@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=kdipendra88@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).