On 2024/11/14 2:56, Stephen Hemminger wrote:
> Doing memset before free maybe removed by compiler, and
> is flagged by security scanning tools as potential problem.
> In this case the memset is unnecessary.
> 
> Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
> ---
>  drivers/bus/uacce/uacce.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/bus/uacce/uacce.c b/drivers/bus/uacce/uacce.c
> index c1529c38c0..35c1027245 100644
> --- a/drivers/bus/uacce/uacce.c
> +++ b/drivers/bus/uacce/uacce.c
> @@ -454,7 +454,6 @@ uacce_cleanup(void)
>               dev->device.driver = NULL;
>  
>  free:
> -             memset(dev, 0, sizeof(*dev));

It should replaced by TAILQ_REMOVE(&uacce_bus.device_list, dev, next);

And I also find other bus have the same problem, later I will push one patchset.

>               free(dev);
>       }
>  

Reply via email to