Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp155306ybm; Thu, 28 May 2020 19:00:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSpJuqHr5+VCgTk2ox+vWYkO7lca+qDM9raHLos7UCGazqxqpo1RTwCxNXfVMZOr6Df5Ur X-Received: by 2002:a17:906:d933:: with SMTP id rn19mr4664917ejb.158.1590717625265; Thu, 28 May 2020 19:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590717625; cv=none; d=google.com; s=arc-20160816; b=hafzpHxAd21QZYmItJctox25/ZFzVHwWR3aqO2u2zIOi1LavqPQvnfo18PmyJR14F8 cCuTPvoMRI50yP4Banj5QEiayCVnkaYL8/WhCHr5PPT89JL0571c/nMhgs9Z4k0awI8B xKLgiKFOnxkfz+HotmunfMowDqZwG9UbJdcSrZLm/BzFJqYrwZ8h8fBwlE7Ub4yy6nBa w8KVzakm8we2X3Bjexh0e738drxBptTBfQW7RS2Y2bny2woxxXYDqonb956GQH2d8e6q yjdZaOyYtrgqZYUAKTprKNsFFADreTQ+eDLGqUAwitv7UW/8jXB96oKdOFe8TepL0P6p L/hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=lV0KpJGr/4Cy5dA+k+PVdDZ9U4XAJmdB3pKLI+v7nWo=; b=UKIbEdiHxDR3Zfg1ccq5ijoV8wJjrDX9ETyF5s10N5YjxadTqpZIGQPZFMjMLwXdwq wwA/mJG1LwKEb3McGwbgj2CSCXnCRkGyP1czABYH4EFfZOPUpGSPaDA6F6G8TTorG8w1 MgBWovLwz4tB1aT5owXMOvj23yKYsIQZD4YSXedssYvsorQUnhq+waKIO2oGmb+YFO6G Aq0h2Tp+bXR8tq4Cmv0QI/2PBg8+80i89sPlK3gqcyjGzPMdivXZtCj5oRoHjf+UZWDS jFIluR7G4mRZPhDccQLHPWDSfeWfbTBv14Bf6A5nNE++hvy+lP7S7XzxowY3LY/faH1W tmLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si4400762eju.658.2020.05.28.19.00.01; Thu, 28 May 2020 19:00:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404469AbgE2B4O (ORCPT + 99 others); Thu, 28 May 2020 21:56:14 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:40174 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390018AbgE2B4N (ORCPT ); Thu, 28 May 2020 21:56:13 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B273461E77528AE2947B; Fri, 29 May 2020 09:56:10 +0800 (CST) Received: from [127.0.0.1] (10.74.149.191) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Fri, 29 May 2020 09:56:01 +0800 Subject: Re: [PATCH 02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ad_dev() To: Markus Elfring , CC: , , "David S. Miller" , Jakub Kicinski , Salil Mehta , Yisen Zhuang References: <913bb77c-6190-9ce7-a46d-906998866073@web.de> From: tanhuazhong Message-ID: <9c50ab14-c5c7-129f-0e51-d40a4c552fd8@huawei.com> Date: Fri, 29 May 2020 09:56:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <913bb77c-6190-9ce7-a46d-906998866073@web.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.149.191] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/5/29 2:42, Markus Elfring wrote: >> Add a mutex destroy call in hclge_init_ae_dev() when fails. > > How do you think about a wording variant like the following? > > Change description: > The function “mutex_init” was called before a call of > the function “hclge_pci_init”. > But the function “mutex_destroy” was not called after initialisation > steps failed. > Thus add the missed function call for the completion of > the exception handling. > It looks better. I will try to improve the skill of patch description and make as many as people can understand the patch. Thanks for help. > > Would you like to add the tag “Fixes” to the commit message? > Since it seems not a very urgent issue, so i send it to the -next and make it as a code optimization. Thanks:) > > … >> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c >> @@ -10108,6 +10108,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) >> pci_release_regions(pdev); >> pci_disable_device(pdev); >> out: >> + mutex_destroy(&hdev->vport_lock); >> return ret; >> } > > How do you think about to use the label “destroy_mutex” instead? Will use label 'destroy_mutex‘ instead if there is another patch need to modify this code, which is more readable. Thanks for your comments. > > Regards, > Markus > >