Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v5.10] uio_hv_generic: Fix another memory leak in error handling  paths
@ 2025-08-11  5:38 Shivani Agarwal
  2025-08-11 22:30 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Shivani Agarwal @ 2025-08-11  5:38 UTC (permalink / raw)
  To: stable, gregkh
  Cc: bcm-kernel-feedback-list, linux-kernel, ajay.kaher,
	alexey.makhalov, tapas.kundu, kys, haiyangz, wei.liu, decui,
	stephen, linux-hyperv, Christophe JAILLET, Shivani Agarwal

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

commit 0b0226be3a52dadd965644bc52a807961c2c26df upstream.

Memory allocated by 'vmbus_alloc_ring()' at the beginning of the probe
function is never freed in the error handling path.

Add the missing 'vmbus_free_ring()' call.

Note that it is already freed in the .remove function.

Fixes: cdfa835c6e5e ("uio_hv_generic: defer opening vmbus until first use")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/0d86027b8eeed8e6360bc3d52bcdb328ff9bdca1.1620544055.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[Shivani: Modified to apply on 5.10.y]
Signed-off-by: Shivani Agarwal <shivani.agarwal@broadcom.com>
---
 drivers/uio/uio_hv_generic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 6625d340f..865a5b289 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -306,7 +306,7 @@ hv_uio_probe(struct hv_device *dev,
 	pdata->recv_buf = vzalloc(RECV_BUFFER_SIZE);
 	if (pdata->recv_buf == NULL) {
 		ret = -ENOMEM;
-		goto fail_close;
+		goto fail_free_ring;
 	}

 	ret = vmbus_establish_gpadl(channel, pdata->recv_buf,
@@ -366,6 +366,8 @@ hv_uio_probe(struct hv_device *dev,

 fail_close:
 	hv_uio_cleanup(dev, pdata);
+fail_free_ring:
+	vmbus_free_ring(dev->channel);

 	return ret;
 }

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

* Re: [PATCH v5.10] uio_hv_generic: Fix another memory leak in error handling  paths
  2025-08-11  5:38 [PATCH v5.10] uio_hv_generic: Fix another memory leak in error handling paths Shivani Agarwal
@ 2025-08-11 22:30 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2025-08-11 22:30 UTC (permalink / raw)
  To: stable, shivani.agarwal; +Cc: Sasha Levin

[ Sasha's backport helper bot ]

Hi,

Summary of potential issues:
❌ Patch application failures detected

The upstream commit SHA1 provided is correct: 0b0226be3a52dadd965644bc52a807961c2c26df

WARNING: Author mismatch between patch and upstream commit:
Backport author: Shivani Agarwal <shivani.agarwal@broadcom.com>
Commit author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Status in newer kernel trees:
6.15.y | Present (exact SHA1)
6.12.y | Present (exact SHA1)
6.6.y | Present (exact SHA1)
6.1.y | Present (exact SHA1)
5.15.y | Present (exact SHA1)

Note: Could not generate a diff with upstream commit:
---
Note: Could not generate diff - patch failed to apply for comparison
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| origin/linux-5.10.y       | Failed      | N/A        |

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

end of thread, other threads:[~2025-08-11 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11  5:38 [PATCH v5.10] uio_hv_generic: Fix another memory leak in error handling paths Shivani Agarwal
2025-08-11 22:30 ` Sasha Levin

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