From: Benjamin Marzinski Subject: Re: [PATCH] devmapper: remove useless using of memset in dm_get_info func Date: Thu, 30 Jul 2020 17:16:20 -0500 Message-ID: <20200730221620.GC19233@octiron.msp.redhat.com> References: <0cbfeea7-5f30-a148-555b-19af2429c32c@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <0cbfeea7-5f30-a148-555b-19af2429c32c@huawei.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Content-Disposition: inline To: Zhiqiang Liu Cc: linfeilong , dm-devel@redhat.com, lixiaokeng , Martin Wilck List-Id: dm-devel.ids 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 Reviewed-by: Benjamin Marzinski > --- > 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 >