linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: Fix dangling pointer access
@ 2021-12-02 22:15 Ameer Hamza
  2021-12-02 22:56 ` Saeed Mahameed
  0 siblings, 1 reply; 2+ messages in thread
From: Ameer Hamza @ 2021-12-02 22:15 UTC (permalink / raw)
  To: saeedm, leon, davem, kuba; +Cc: netdev, linux-rdma, linux-kernel, amhamza.mgc

Fix for dangling pointer access reported by Coverity.

Addresses-Coverity: 1494138 ("Use after free")

Signed-off-by: Ameer Hamza <amhamza.mgc@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c
index 3ca998874c50..856023321972 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
@@ -335,7 +335,7 @@ static int mlx5_health_try_recover(struct mlx5_core_dev *dev)
 {
 	mlx5_core_warn(dev, "handling bad device here\n");
 	mlx5_handle_bad_state(dev);
-	if (mlx5_health_wait_pci_up(dev)) {
+	if (dev->timeouts && mlx5_health_wait_pci_up(dev)) {
 		mlx5_core_err(dev, "health recovery flow aborted, PCI reads still not working\n");
 		return -EIO;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/mlx5: Fix dangling pointer access
  2021-12-02 22:15 [PATCH] net/mlx5: Fix dangling pointer access Ameer Hamza
@ 2021-12-02 22:56 ` Saeed Mahameed
  0 siblings, 0 replies; 2+ messages in thread
From: Saeed Mahameed @ 2021-12-02 22:56 UTC (permalink / raw)
  To: amhamza.mgc, davem, kuba, leon; +Cc: netdev, linux-rdma, linux-kernel

On Fri, 2021-12-03 at 03:15 +0500, Ameer Hamza wrote:
> Fix for dangling pointer access reported by Coverity.
> 
> Addresses-Coverity: 1494138 ("Use after free")
> 
> Signed-off-by: Ameer Hamza <amhamza.mgc@gmail.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c
> b/drivers/net/ethernet/mellanox/mlx5/core/health.c
> index 3ca998874c50..856023321972 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
> @@ -335,7 +335,7 @@ static int mlx5_health_try_recover(struct
> mlx5_core_dev *dev)
>  {
>         mlx5_core_warn(dev, "handling bad device here\n");
>         mlx5_handle_bad_state(dev);
> -       if (mlx5_health_wait_pci_up(dev)) {
> +       if (dev->timeouts && mlx5_health_wait_pci_up(dev)) {


the proper fix was already submitted and accepted to net:
https://lore.kernel.org/netdev/20211201063709.229103-11-saeed@kernel.org/

Thank you


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-02 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 22:15 [PATCH] net/mlx5: Fix dangling pointer access Ameer Hamza
2021-12-02 22:56 ` Saeed Mahameed

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).