Re: [PATCH 1/2] staging: vme_user: add list_del in the error handling of tsi148_dma_list_add

From: Christophe JAILLET
Date: Sat Nov 26 2022 - 10:32:16 EST


Le 26/11/2022 à 13:56, Dongliang Mu a écrit :
Smatch reports the following issue:
drivers/staging/vme_user/vme_tsi148.c:1757 tsi148_dma_list_add()
warn: '&entry->list' not removed from list


Hi,

Not tested with smatch, but I think that moving the list_add_tail() call just a few lines below, when all lights are green, would also fix the issue.

Just my 2c,

CJ


Fix this by adding list_del in the error handling code.

Signed-off-by: Dongliang Mu <dzm91@xxxxxxxxxxx>
---
drivers/staging/vme_user/vme_tsi148.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
index 020e0b3bce64..0171f46d1848 100644
--- a/drivers/staging/vme_user/vme_tsi148.c
+++ b/drivers/staging/vme_user/vme_tsi148.c
@@ -1751,6 +1751,7 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
return 0;
err_dma:
+ list_del(&entry->list);
err_dest:
err_source:
err_align: