linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/qib: Fix memory leak in qib_user_sdma_queue_pkts
@ 2021-12-08 17:52 José Expósito
  2021-12-08 18:07 ` Marciniszyn, Mike
  2021-12-15  0:07 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: José Expósito @ 2021-12-08 17:52 UTC (permalink / raw)
  To: dennis.dalessandro
  Cc: mike.marciniszyn, dledford, jgg, linux-rdma, linux-kernel,
	José Expósito

Addresses-Coverity-ID: 1493352 ("Resource leak")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
 drivers/infiniband/hw/qib/qib_user_sdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c b/drivers/infiniband/hw/qib/qib_user_sdma.c
index ac11943a5ddb..bf2f30d67949 100644
--- a/drivers/infiniband/hw/qib/qib_user_sdma.c
+++ b/drivers/infiniband/hw/qib/qib_user_sdma.c
@@ -941,7 +941,7 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,
 					       &addrlimit) ||
 			    addrlimit > type_max(typeof(pkt->addrlimit))) {
 				ret = -EINVAL;
-				goto free_pbc;
+				goto free_pkt;
 			}
 			pkt->addrlimit = addrlimit;
 
-- 
2.25.1


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

* RE: [PATCH] IB/qib: Fix memory leak in qib_user_sdma_queue_pkts
  2021-12-08 17:52 [PATCH] IB/qib: Fix memory leak in qib_user_sdma_queue_pkts José Expósito
@ 2021-12-08 18:07 ` Marciniszyn, Mike
  2021-12-15  0:07 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Marciniszyn, Mike @ 2021-12-08 18:07 UTC (permalink / raw)
  To: José Expósito, Dalessandro, Dennis
  Cc: dledford, jgg, linux-rdma, linux-kernel

> Subject: [PATCH] IB/qib: Fix memory leak in qib_user_sdma_queue_pkts
> 
> Addresses-Coverity-ID: 1493352 ("Resource leak")
> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
> ---
>  drivers/infiniband/hw/qib/qib_user_sdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c
> b/drivers/infiniband/hw/qib/qib_user_sdma.c
> index ac11943a5ddb..bf2f30d67949 100644
> --- a/drivers/infiniband/hw/qib/qib_user_sdma.c
> +++ b/drivers/infiniband/hw/qib/qib_user_sdma.c
> @@ -941,7 +941,7 @@ static int qib_user_sdma_queue_pkts(const struct
> qib_devdata *dd,
>  					       &addrlimit) ||
>  			    addrlimit > type_max(typeof(pkt->addrlimit))) {
>  				ret = -EINVAL;
> -				goto free_pbc;
> +				goto free_pkt;
>  			}
>  			pkt->addrlimit = addrlimit;
> 
> --
Thanks for catching my mistake!

Mike

Acked-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Fixes d39bf40e55e6 ("IB/qib: Protect from buffer overflow in struct qib_user_sdma_pkt fields"): 

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

* Re: [PATCH] IB/qib: Fix memory leak in qib_user_sdma_queue_pkts
  2021-12-08 17:52 [PATCH] IB/qib: Fix memory leak in qib_user_sdma_queue_pkts José Expósito
  2021-12-08 18:07 ` Marciniszyn, Mike
@ 2021-12-15  0:07 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2021-12-15  0:07 UTC (permalink / raw)
  To: José Expósito
  Cc: dennis.dalessandro, mike.marciniszyn, dledford, linux-rdma, linux-kernel

On Wed, Dec 08, 2021 at 06:52:38PM +0100, José Expósito wrote:
> Addresses-Coverity-ID: 1493352 ("Resource leak")
> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
> Acked-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
> ---
>  drivers/infiniband/hw/qib/qib_user_sdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc.

I wrote a commit message and added the missing fixes line, please take
care in future.

Jason

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

end of thread, other threads:[~2021-12-15  0:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 17:52 [PATCH] IB/qib: Fix memory leak in qib_user_sdma_queue_pkts José Expósito
2021-12-08 18:07 ` Marciniszyn, Mike
2021-12-15  0:07 ` Jason Gunthorpe

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