All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: vme_user: add list_del in the error handling of tsi148_dma_list_add
@ 2022-11-26 12:56 Dongliang Mu
  2022-11-26 12:56 ` [PATCH 2/2] staging: vme_user: fix coding style Dongliang Mu
  2022-11-26 15:31 ` [PATCH 1/2] staging: vme_user: add list_del in the error handling of tsi148_dma_list_add Christophe JAILLET
  0 siblings, 2 replies; 5+ messages in thread
From: Dongliang Mu @ 2022-11-26 12:56 UTC (permalink / raw)
  To: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, Dongliang Mu,
	Arnd Bergmann, Mingyi Kang
  Cc: linux-kernel, linux-staging

Smatch reports the following issue:
drivers/staging/vme_user/vme_tsi148.c:1757 tsi148_dma_list_add()
warn: '&entry->list' not removed from list

Fix this by adding list_del in the error handling code.

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
---
 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:
-- 
2.37.1 (Apple Git-137.1)


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

* [PATCH 2/2] staging: vme_user: fix coding style
  2022-11-26 12:56 [PATCH 1/2] staging: vme_user: add list_del in the error handling of tsi148_dma_list_add Dongliang Mu
@ 2022-11-26 12:56 ` Dongliang Mu
  2022-12-05 12:22   ` Greg Kroah-Hartman
  2022-11-26 15:31 ` [PATCH 1/2] staging: vme_user: add list_del in the error handling of tsi148_dma_list_add Christophe JAILLET
  1 sibling, 1 reply; 5+ messages in thread
From: Dongliang Mu @ 2022-11-26 12:56 UTC (permalink / raw)
  To: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, Dongliang Mu,
	Arnd Bergmann, Mingyi Kang
  Cc: linux-kernel, linux-staging

Fix coding style enforced by Linux kernel

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

diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
index 0171f46d1848..5ba097e4d17e 100644
--- a/drivers/staging/vme_user/vme_tsi148.c
+++ b/drivers/staging/vme_user/vme_tsi148.c
@@ -1755,7 +1755,7 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
 err_dest:
 err_source:
 err_align:
-		kfree(entry);
+	kfree(entry);
 err_mem:
 	return retval;
 }
-- 
2.37.1 (Apple Git-137.1)


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

* Re: [PATCH 1/2] staging: vme_user: add list_del in the error handling of tsi148_dma_list_add
  2022-11-26 12:56 [PATCH 1/2] staging: vme_user: add list_del in the error handling of tsi148_dma_list_add Dongliang Mu
  2022-11-26 12:56 ` [PATCH 2/2] staging: vme_user: fix coding style Dongliang Mu
@ 2022-11-26 15:31 ` Christophe JAILLET
  1 sibling, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2022-11-26 15:31 UTC (permalink / raw)
  To: Dongliang Mu, Martyn Welch, Manohar Vanga, Greg Kroah-Hartman,
	Arnd Bergmann, Mingyi Kang
  Cc: linux-kernel, linux-staging

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@hust.edu.cn>
> ---
>   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:


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

* Re: [PATCH 2/2] staging: vme_user: fix coding style
  2022-11-26 12:56 ` [PATCH 2/2] staging: vme_user: fix coding style Dongliang Mu
@ 2022-12-05 12:22   ` Greg Kroah-Hartman
  2022-12-05 12:33     ` Dongliang Mu
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2022-12-05 12:22 UTC (permalink / raw)
  To: Dongliang Mu
  Cc: Martyn Welch, Manohar Vanga, Arnd Bergmann, Mingyi Kang,
	linux-kernel, linux-staging

On Sat, Nov 26, 2022 at 08:56:34PM +0800, Dongliang Mu wrote:
> Fix coding style enforced by Linux kernel

What coding style was changed?  Please always be specific.

thanks,

greg k-h

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

* Re: [PATCH 2/2] staging: vme_user: fix coding style
  2022-12-05 12:22   ` Greg Kroah-Hartman
@ 2022-12-05 12:33     ` Dongliang Mu
  0 siblings, 0 replies; 5+ messages in thread
From: Dongliang Mu @ 2022-12-05 12:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Martyn Welch, Manohar Vanga, Arnd Bergmann, Mingyi Kang,
	linux-kernel, linux-staging



> On Dec 5, 2022, at 20:22, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> 
> On Sat, Nov 26, 2022 at 08:56:34PM +0800, Dongliang Mu wrote:
>> Fix coding style enforced by Linux kernel
> 
> What coding style was changed?  Please always be specific.

The commit message is imprecise. Actually, this patch only fixes the code indentation issue of kfree function call.

Will fix it in v2.

> 
> thanks,
> 
> greg k-h


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

end of thread, other threads:[~2022-12-05 12:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-26 12:56 [PATCH 1/2] staging: vme_user: add list_del in the error handling of tsi148_dma_list_add Dongliang Mu
2022-11-26 12:56 ` [PATCH 2/2] staging: vme_user: fix coding style Dongliang Mu
2022-12-05 12:22   ` Greg Kroah-Hartman
2022-12-05 12:33     ` Dongliang Mu
2022-11-26 15:31 ` [PATCH 1/2] staging: vme_user: add list_del in the error handling of tsi148_dma_list_add Christophe JAILLET

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.