[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220529153456.4183738-3-cgxu519@mykernel.net>
Date: Sun, 29 May 2022 23:34:52 +0800
From: Chengguang Xu <cgxu519@...ernel.net>
To: netdev@...r.kernel.org, linux-staging@...ts.linux.dev,
linux-scsi@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-media@...r.kernel.org
Cc: Chengguang Xu <cgxu519@...ernel.net>
Subject: [PATCH 2/6] staging: vt6655: fix missing resource cleanup in error cases
Fix missing resource cleanup(when '(--i) == 0') for error cases
Signed-off-by: Chengguang Xu <cgxu519@...ernel.net>
---
drivers/staging/vt6655/device_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 897d70cf32b8..cf8d92e785e6 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -565,7 +565,7 @@ static int device_init_rd0_ring(struct vnt_private *priv)
kfree(desc->rd_info);
err_free_desc:
- while (--i) {
+ while (--i >= 0) {
desc = &priv->aRD0Ring[i];
device_free_rx_buf(priv, desc);
kfree(desc->rd_info);
@@ -611,7 +611,7 @@ static int device_init_rd1_ring(struct vnt_private *priv)
kfree(desc->rd_info);
err_free_desc:
- while (--i) {
+ while (--i >= 0) {
desc = &priv->aRD1Ring[i];
device_free_rx_buf(priv, desc);
kfree(desc->rd_info);
@@ -676,7 +676,7 @@ static int device_init_td0_ring(struct vnt_private *priv)
return 0;
err_free_desc:
- while (--i) {
+ while (--i >= 0) {
desc = &priv->apTD0Rings[i];
kfree(desc->td_info);
}
@@ -716,7 +716,7 @@ static int device_init_td1_ring(struct vnt_private *priv)
return 0;
err_free_desc:
- while (--i) {
+ while (--i >= 0) {
desc = &priv->apTD1Rings[i];
kfree(desc->td_info);
}
--
2.27.0
Powered by blists - more mailing lists