VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Christophe JAILLET <christophe.jaillet@wanadoo.fr> 2021-05-09 09:13:12 +0200 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-05-14 13:26:04 +0200 commit: 0b0226be3a52dadd965644bc52a807961c2c26df parent: 3ee098f96b8b6c1a98f7f97915f8873164e6af9d
Commit Summary:
uio_hv_generic: Fix another memory leak in error handling paths
Diffstat:
1 file changed, 3 insertions, 1 deletion
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index eebc399f2cc7..652fe2547587 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -291,7 +291,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,
@@ -351,6 +351,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;
 }