diff mbox series

IB/qib: Fix memory leak in qib_user_sdma_queue_pkts

Message ID 20211208175238.29983-1-jose.exposito89@gmail.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series IB/qib: Fix memory leak in qib_user_sdma_queue_pkts | expand

Commit Message

José Expósito Dec. 8, 2021, 5:52 p.m. UTC
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(-)

Comments

Marciniszyn, Mike Dec. 8, 2021, 6:07 p.m. UTC | #1
> 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"):
Jason Gunthorpe Dec. 15, 2021, 12:07 a.m. UTC | #2
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
diff mbox series

Patch

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;