From patchwork Thu Jul 30 14:06:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhiqiang Liu X-Patchwork-Id: 11693135 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3959413B1 for ; Thu, 30 Jul 2020 14:09:44 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B0D3206D8 for ; Thu, 30 Jul 2020 14:09:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B0D3206D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-432-xl08q0myOnOZWZTCnF-dgw-1; Thu, 30 Jul 2020 10:09:37 -0400 X-MC-Unique: xl08q0myOnOZWZTCnF-dgw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B964A800597; Thu, 30 Jul 2020 14:09:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79FE361982; Thu, 30 Jul 2020 14:09:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3AB2195A7E; Thu, 30 Jul 2020 14:09:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06UE7xDw019478 for ; Thu, 30 Jul 2020 10:08:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C2F5111287B; Thu, 30 Jul 2020 14:07:59 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 978621112874 for ; Thu, 30 Jul 2020 14:07:57 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52683800658 for ; Thu, 30 Jul 2020 14:07:57 +0000 (UTC) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-370-0KiW0paNNDya9MhaEUgwhQ-1; Thu, 30 Jul 2020 10:06:47 -0400 X-MC-Unique: 0KiW0paNNDya9MhaEUgwhQ-1 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C24D6542FBBE5E45A45B; Thu, 30 Jul 2020 22:06:43 +0800 (CST) Received: from [127.0.0.1] (10.174.179.249) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Thu, 30 Jul 2020 22:06:35 +0800 To: , , Martin Wilck From: Zhiqiang Liu Message-ID: <0cbfeea7-5f30-a148-555b-19af2429c32c@huawei.com> Date: Thu, 30 Jul 2020 22:06:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Language: en-US X-Originating-IP: [10.174.179.249] X-CFilter-Loop: Reflected X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: dm-devel@redhat.com Cc: linfeilong , lixiaokeng , dm-devel@redhat.com Subject: [dm-devel] [PATCH] devmapper: remove useless using of memset in dm_get_info func X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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;