Re: [PATCH] devmapper: remove useless using of memset in dm_get_info func

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 30, 2020 at 10:06:35PM +0800, Zhiqiang Liu wrote:
> 
> In dm_get_info func, if do_get_info fails, we donot need to
> call memset to assign 0 to *dmi which will be freed.
> 
> Here, we remove the useless using of memset in dm_get_info func.
> 
> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@xxxxxxxxxx>
Reviewed-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
> ---
>  libmultipath/devmapper.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
> index f597ff8b..00ee0dfc 100644
> --- a/libmultipath/devmapper.c
> +++ b/libmultipath/devmapper.c
> @@ -1464,7 +1464,6 @@ dm_get_info (const char * mapname, struct dm_info ** dmi)
>  		return 1;
> 
>  	if (do_get_info(mapname, *dmi) != 0) {
> -		memset(*dmi, 0, sizeof(struct dm_info));
>  		FREE(*dmi);
>  		*dmi = NULL;
>  		return 1;
> -- 
> 2.24.0.windows.2
> 

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux