Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH] RDMA/mana_ib: Ensure variable err is initialized
@ 2025-02-21 19:39 Kees Bakker
  2025-02-21 20:34 ` [EXTERNAL] " Long Li
  2025-02-23 11:28 ` Leon Romanovsky
  0 siblings, 2 replies; 4+ messages in thread
From: Kees Bakker @ 2025-02-21 19:39 UTC (permalink / raw)
  To: Long Li, Konstantin Taranov, Jason Gunthorpe, Leon Romanovsky
  Cc: linux-rdma, linux-kernel

In the function mana_ib_gd_create_dma_region if there are no dma blocks
to process the variable `err` remains uninitialized.

Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
Signed-off-by: Kees Bakker <kees@ijzerbout.nl>
---
 drivers/infiniband/hw/mana/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c
index 114ca8c509ce..eda9c5b971de 100644
--- a/drivers/infiniband/hw/mana/main.c
+++ b/drivers/infiniband/hw/mana/main.c
@@ -384,7 +384,7 @@ static int mana_ib_gd_create_dma_region(struct mana_ib_dev *dev, struct ib_umem
 	unsigned int tail = 0;
 	u64 *page_addr_list;
 	void *request_buf;
-	int err;
+	int err = 0;
 
 	gc = mdev_to_gc(dev);
 	hwc = gc->hwc.driver_data;
-- 
2.48.1


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

* RE: [EXTERNAL] [PATCH] RDMA/mana_ib: Ensure variable err is initialized
  2025-02-21 19:39 [PATCH] RDMA/mana_ib: Ensure variable err is initialized Kees Bakker
@ 2025-02-21 20:34 ` Long Li
  2025-02-23 11:28   ` Leon Romanovsky
  2025-02-23 11:28 ` Leon Romanovsky
  1 sibling, 1 reply; 4+ messages in thread
From: Long Li @ 2025-02-21 20:34 UTC (permalink / raw)
  To: Kees Bakker, Konstantin Taranov, Jason Gunthorpe, Leon Romanovsky
  Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org

> Subject: [EXTERNAL] [PATCH] RDMA/mana_ib: Ensure variable err is initialized
> 
> [Some people who received this message don't often get email from
> kees@ijzerbout.nl. Learn why this is important at
> https://aka.ms/LearnAboutSenderIdentification ]
> 
> In the function mana_ib_gd_create_dma_region if there are no dma blocks to
> process the variable `err` remains uninitialized.
> 
> Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure
> Network Adapter")
> Signed-off-by: Kees Bakker <kees@ijzerbout.nl>

I think it's an impossible condition, but the patch looks good to me.

Reviewed-by: Long Li <longli@microsoft.com>

> ---
>  drivers/infiniband/hw/mana/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/mana/main.c
> b/drivers/infiniband/hw/mana/main.c
> index 114ca8c509ce..eda9c5b971de 100644
> --- a/drivers/infiniband/hw/mana/main.c
> +++ b/drivers/infiniband/hw/mana/main.c
> @@ -384,7 +384,7 @@ static int mana_ib_gd_create_dma_region(struct
> mana_ib_dev *dev, struct ib_umem
>         unsigned int tail = 0;
>         u64 *page_addr_list;
>         void *request_buf;
> -       int err;
> +       int err = 0;
> 
>         gc = mdev_to_gc(dev);
>         hwc = gc->hwc.driver_data;
> --
> 2.48.1


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

* Re: [EXTERNAL] [PATCH] RDMA/mana_ib: Ensure variable err is initialized
  2025-02-21 20:34 ` [EXTERNAL] " Long Li
@ 2025-02-23 11:28   ` Leon Romanovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2025-02-23 11:28 UTC (permalink / raw)
  To: Long Li
  Cc: Kees Bakker, Konstantin Taranov, Jason Gunthorpe,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org

On Fri, Feb 21, 2025 at 08:34:43PM +0000, Long Li wrote:
> > Subject: [EXTERNAL] [PATCH] RDMA/mana_ib: Ensure variable err is initialized
> > 
> > [Some people who received this message don't often get email from
> > kees@ijzerbout.nl. Learn why this is important at
> > https://aka.ms/LearnAboutSenderIdentification ]
> > 
> > In the function mana_ib_gd_create_dma_region if there are no dma blocks to
> > process the variable `err` remains uninitialized.
> > 
> > Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure
> > Network Adapter")
> > Signed-off-by: Kees Bakker <kees@ijzerbout.nl>
> 
> I think it's an impossible condition, but the patch looks good to me.

Agree, it is impossible.

> 
> Reviewed-by: Long Li <longli@microsoft.com>

Thanks

> 
> > ---
> >  drivers/infiniband/hw/mana/main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/infiniband/hw/mana/main.c
> > b/drivers/infiniband/hw/mana/main.c
> > index 114ca8c509ce..eda9c5b971de 100644
> > --- a/drivers/infiniband/hw/mana/main.c
> > +++ b/drivers/infiniband/hw/mana/main.c
> > @@ -384,7 +384,7 @@ static int mana_ib_gd_create_dma_region(struct
> > mana_ib_dev *dev, struct ib_umem
> >         unsigned int tail = 0;
> >         u64 *page_addr_list;
> >         void *request_buf;
> > -       int err;
> > +       int err = 0;
> > 
> >         gc = mdev_to_gc(dev);
> >         hwc = gc->hwc.driver_data;
> > --
> > 2.48.1
> 

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

* Re: [PATCH] RDMA/mana_ib: Ensure variable err is initialized
  2025-02-21 19:39 [PATCH] RDMA/mana_ib: Ensure variable err is initialized Kees Bakker
  2025-02-21 20:34 ` [EXTERNAL] " Long Li
@ 2025-02-23 11:28 ` Leon Romanovsky
  1 sibling, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2025-02-23 11:28 UTC (permalink / raw)
  To: Long Li, Konstantin Taranov, Jason Gunthorpe, Kees Bakker
  Cc: linux-rdma, linux-kernel


On Fri, 21 Feb 2025 20:39:03 +0100, Kees Bakker wrote:
> In the function mana_ib_gd_create_dma_region if there are no dma blocks
> to process the variable `err` remains uninitialized.
> 
> 

Applied, thanks!

[1/1] RDMA/mana_ib: Ensure variable err is initialized
      https://git.kernel.org/rdma/rdma/c/be35a3127d6096

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


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

end of thread, other threads:[~2025-02-23 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21 19:39 [PATCH] RDMA/mana_ib: Ensure variable err is initialized Kees Bakker
2025-02-21 20:34 ` [EXTERNAL] " Long Li
2025-02-23 11:28   ` Leon Romanovsky
2025-02-23 11:28 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox