* [PATCH net 1/1] net/mlx5: Avoid dereferencing uninitialized pointer
@ 2017-03-28 13:13 Saeed Mahameed
2017-03-29 1:07 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Saeed Mahameed @ 2017-03-28 13:13 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Talat Batheesh, Saeed Mahameed
From: Talat Batheesh <talatb@mellanox.com>
In NETDEV_CHANGEUPPER event the upper_info field is valid
only when linking is true. Otherwise it should be ignored.
Fixes: 7907f23adc18 (net/mlx5: Implement RoCE LAG feature)
Signed-off-by: Talat Batheesh <talatb@mellanox.com>
Reviewed-by: Aviv Heller <avivh@mellanox.com>
Reviewed-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
Hi Dave,
I will appreciate it if you queue up this patch for v4.9-stable.
Thanks in advance,
Saeed.
drivers/net/ethernet/mellanox/mlx5/core/lag.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag.c
index 55957246c0e8..b5d5519542e8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag.c
@@ -294,7 +294,7 @@ static int mlx5_handle_changeupper_event(struct mlx5_lag *ldev,
struct netdev_notifier_changeupper_info *info)
{
struct net_device *upper = info->upper_dev, *ndev_tmp;
- struct netdev_lag_upper_info *lag_upper_info;
+ struct netdev_lag_upper_info *lag_upper_info = NULL;
bool is_bonded;
int bond_status = 0;
int num_slaves = 0;
@@ -303,7 +303,8 @@ static int mlx5_handle_changeupper_event(struct mlx5_lag *ldev,
if (!netif_is_lag_master(upper))
return 0;
- lag_upper_info = info->upper_info;
+ if (info->linking)
+ lag_upper_info = info->upper_info;
/* The event may still be of interest if the slave does not belong to
* us, but is enslaved to a master which has one or more of our netdevs
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net 1/1] net/mlx5: Avoid dereferencing uninitialized pointer
2017-03-28 13:13 [PATCH net 1/1] net/mlx5: Avoid dereferencing uninitialized pointer Saeed Mahameed
@ 2017-03-29 1:07 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-03-29 1:07 UTC (permalink / raw)
To: saeedm; +Cc: netdev, talatb
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Tue, 28 Mar 2017 16:13:41 +0300
> From: Talat Batheesh <talatb@mellanox.com>
>
> In NETDEV_CHANGEUPPER event the upper_info field is valid
> only when linking is true. Otherwise it should be ignored.
>
> Fixes: 7907f23adc18 (net/mlx5: Implement RoCE LAG feature)
> Signed-off-by: Talat Batheesh <talatb@mellanox.com>
> Reviewed-by: Aviv Heller <avivh@mellanox.com>
> Reviewed-by: Moni Shoua <monis@mellanox.com>
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> ---
>
> Hi Dave,
>
> I will appreciate it if you queue up this patch for v4.9-stable.
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-29 1:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28 13:13 [PATCH net 1/1] net/mlx5: Avoid dereferencing uninitialized pointer Saeed Mahameed
2017-03-29 1:07 ` David Miller
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.