Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp502614ybg; Mon, 1 Jun 2020 07:05:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT2qAWvFNIEccL/tyO2EjY/77zC5nQTKfxApSB4tXsKMxkqt5sKFg3o5Qe+QssCZaTQBr5 X-Received: by 2002:a05:6402:1247:: with SMTP id l7mr9995830edw.61.1591020321026; Mon, 01 Jun 2020 07:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591020321; cv=none; d=google.com; s=arc-20160816; b=wp5SBNBKrI0BSMJgQOaXffgJTMifO/SzjgkhZWX62UpTdR/QAI2/zM5S29UnINJVxc v4anFi3m4tuIW24mYyCvs9B8kBk2HU6Se5nUG2iJxoO0CTEXK5+Yqq/cAz03KwTYGSr+ kimzSaC2cHrojOfjiLGHuX6PxOowhNyNn0w51lK3pTG0zR+ty8eKK7epltZygGV09gfJ 5ikp5JtT1IrVeLxbb7XTXtM+eHRYlCymMNIbH8jWDAenkeo2PILKDMqOf/z9liGmqfBN k5TmFthw7sRJ/N5mZu5R3hof/Bulgr4BoeWTQ9Q8t10GumGD11vXC/HNZTlERbP9snJY iqbw== 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:autocrypt:from:references:cc:to:subject:dkim-signature; bh=e4M583n+ndEFe7uz2Jqv6SloIP8i0ix03FxgdPGGvhQ=; b=eHcgmT234FqETGPjqxNT1xioOMKJOPOcNu8OkLKBwBWndzjol3zTojdTtPYS02yX7G 7ftxZGuXJeGiT/FE7qpmO6U9SXNA9gzAksERgtrOdfAlCNFI7sR0paH2lUirDTjSwX1L 81nigoyfwQ8d0UEvf1yMQyurcXy0ROkHs8AaFmeTFSHFew5FNmVSX8yVtP8kbWDuGDIA bKYi/TMlCl8mhqOBUCo/B+qOd9yEsHEeso0aMMn6P++nwpBYfPtLgosRQj4YpOWm/44c +2Nwq+PNCTsqEcG7T+0iV8r+apAxUkxHnQZggdi1aCxSWb0JM4DiNyAYpm1YvVcoMTkS DTDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=ct9Ob0fV; 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 c18si10112714edt.202.2020.06.01.07.04.56; Mon, 01 Jun 2020 07:05:21 -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; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=ct9Ob0fV; 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 S1726218AbgFAOAw (ORCPT + 99 others); Mon, 1 Jun 2020 10:00:52 -0400 Received: from mout.web.de ([212.227.15.3]:50265 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbgFAOAv (ORCPT ); Mon, 1 Jun 2020 10:00:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1591020034; bh=e4M583n+ndEFe7uz2Jqv6SloIP8i0ix03FxgdPGGvhQ=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=ct9Ob0fVIXFHh1FpSun13ZCyN6SGRqjW958I+rXjkNRBFcH4a+vUB9JQLnLli7hhV Mc7DXeXJks9HkufQx42nTt1HEnDeZqPitrreAekK9aX3nKQiawVZiyzzFdPPUWPHGd UQ003s8kf9SMzmGZ7IgI1DMmnKjivUqYj+Jfhayg= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([78.49.133.32]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N4vNQ-1iwuDG2K6m-010sT9; Mon, 01 Jun 2020 16:00:34 +0200 Subject: Re: [1/2] ubifs: Fix potential memory leaks while iterating entries To: Zhihao Cheng , linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Richard Weinberger , Yi Zhang References: <2bec05b7-78d3-fa36-134a-efbe977933e3@web.de> <45e2cd69-93ec-a0b9-b2a6-d170eee44055@huawei.com> From: Markus Elfring Autocrypt: addr=Markus.Elfring@web.de; prefer-encrypt=mutual; keydata= mQINBFg2+xABEADBJW2hoUoFXVFWTeKbqqif8VjszdMkriilx90WB5c0ddWQX14h6w5bT/A8 +v43YoGpDNyhgA0w9CEhuwfZrE91GocMtjLO67TAc2i2nxMc/FJRDI0OemO4VJ9RwID6ltwt mpVJgXGKkNJ1ey+QOXouzlErVvE2fRh+KXXN1Q7fSmTJlAW9XJYHS3BDHb0uRpymRSX3O+E2 lA87C7R8qAigPDZi6Z7UmwIA83ZMKXQ5stA0lhPyYgQcM7fh7V4ZYhnR0I5/qkUoxKpqaYLp YHBczVP+Zx/zHOM0KQphOMbU7X3c1pmMruoe6ti9uZzqZSLsF+NKXFEPBS665tQr66HJvZvY GMDlntZFAZ6xQvCC1r3MGoxEC1tuEa24vPCC9RZ9wk2sY5Csbva0WwYv3WKRZZBv8eIhGMxs rcpeGShRFyZ/0BYO53wZAPV1pEhGLLxd8eLN/nEWjJE0ejakPC1H/mt5F+yQBJAzz9JzbToU 5jKLu0SugNI18MspJut8AiA1M44CIWrNHXvWsQ+nnBKHDHHYZu7MoXlOmB32ndsfPthR3GSv jN7YD4Ad724H8fhRijmC1+RpuSce7w2JLj5cYj4MlccmNb8YUxsE8brY2WkXQYS8Ivse39MX BE66MQN0r5DQ6oqgoJ4gHIV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rRMpkauN4CJ5yTpvp+Orcz5KixHQmc5tbkLWf x0n1QFc1xxJhbzN+r9djSGGN/5IBDfUqSANC8cWzHpWaHmSuU3JSAMB/N+yQjIad2ztTckZY pwT6oxng29LzZspTYUEzMz3wK2jQHw+U66qBFk8whA7B2uAU1QdGyPgahLYSOa4XAEGb6wbI FEE= Message-ID: <4fe27809-552e-ea98-ba1f-cbf68e625d22@web.de> Date: Mon, 1 Jun 2020 16:00:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <45e2cd69-93ec-a0b9-b2a6-d170eee44055@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Obc3LXDUWzNYAR7rOJ2xt8xMNqUN5H+O9DoGw784fRwgkHrQVxb oPmoTc6ELoffvar2f6rRfG01a9xxHevQlOSC4JPSHtoHGwgBhAySkqqvHyvUnF7mNewo3f9 ccgHkfs68V3O/gOtGExNbcaL/IGXFSuUfLEjJ7tiCuBu1ogHJPDJizn3RfoB+6NNm3Ho+Pu ITaeuSIa912MCrFB1Xxlg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:VXWDgan85Jg=:B9USaHgU53/jTmeGtDUtib me6ZCwodrgs8hm3QQ/V+mJguGfFFkYvs1AYNUi+ekCMD1a/ylJfx7eAYKkNAwnGBy5U6p14lC 8BMyu3+W+aJ3zw/3JVfqm+jcedtUPzya/7fWuc+jfetDinHEtp36rvo05KTbYwGo2HHlBFEEc EQJfGl3drXju9u2Cer6DOIU4RZ450Rs0v8C2YSayaG4GxSVwBpF+jwK8UoyHuG4By6KiKYrvx 1KE/4nfc9F3wigtmCjQ6L/r7wpuIz+KgQJyDWJqSj7YW/VBmLNA01DgK0mjdmcZCu7SjGTvLP vtMAs+zdlEtHlRq1sNfQhBJOTTiDhFWbxKKWNeJXNjjN9fXFKfmKC89gF5O8NxmTLP0MZYWlp 7RHa+3qeZY6ex6TwkwW08irGIV63EpzUSrVlYI9iyX8QLsiFbuPiiZ8RcaU77Enrnmj7EfNma gIqtVahHyxcliTBLdy8h8jfbfJM4sZP6fvpVTM/61IHx51wpuyw1nwtBkf9J+Qw7+Il/S/NHr rD7z7JugvB9jIs65yROpUUA2t2oYoxc+VlZkJtf4KCfxpdA4slvJMbxEkZXqxTy4k56lXBveg cmqzZLlroNOA7d1yMMHdrUQmXUa+gDedhBqwSICXcMdsnSxDZq1wObbDlWDY0kAwO5pwwy1RQ NhyHAlJP5YxmHGE+nOFWm+uZr/urxwy7bH3Oh+BDZnW5gZT4PxCE6lBEiw26c4M+Bnn9IXwzY ER3pzly8diSAd6EP+f/wByP377lVAFIzsHjP26aoTX1hZorG4pi4occqIF+FfT539ZZsb6wST GWfb0Sm5bFzl7ONb0AYWnyMtrrjcmL1eW4oqNQBFafsJBnLurg8SZLXXujsb6YJIGjfE8RoGQ iDMpFimtNUEpZCGJbiQKDx8oYESxnNo4fbHa/A4TQY+818VnGapYBfKgrZLwTlRSUIAhJ6C4M w+FVHQeMc+GW765Sbolp5f8S6vkPVtzONe/lgWgPCHRm07rOPwOuxDNEN2zqmMw2eOgT8b50/ /aQKH1ZLBBu7DMhZ3go/azhu5Yiws+8q/G/ufUZEd8YU/qQ8aVWLS2Reda5iXFsUkHmNBsw8Q KsG8WIWuvDzaG1LbHhW7nRihjcQbFrDQEF/6RcWC1z7CXtHDOiFCYEZbTg7ChA46DOvZ3uM8/ gQPh9hmDxru6oWfFcvgKXRR14+d/Bbtk5V/Kdvm/72AJoiOdkuNnhKCkxAaNiZVTo029uh7xv j7DOmAzaUpcVdd/8E Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> I suggest to avoid the specification of duplicate function calls >> (also for the desired exception handling). >> Will it be helpful to add a few jump targets? >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /Documentation/process/coding-style.rst?id=3D3d77e6a8804abcc0504c904bd6e5c= df3a5cf8162#n455 > I've thought about using "goto err_tag_2" in kill_xattrs code block to r= elease prev xent, I propose to choose better labels. > but later it needs to jump to 'out_release tag=E2=80=98 for releasing pr= eviously requested memory, > which can clutter the code. Would you like to reconsider this view? > It seems that two consecutive 'goto tags' will make the code less readab= le. How do you think about to try another software adjustment out in such a de= sign direction? Can it make sense to combine changes together with the update step =E2=80=9Cubifs: dent: Fix some potential memory leaks while iterating entr= ies=E2=80=9D into a single patch? https://lore.kernel.org/linux-mtd/20200601091037.3794172-2-chengzhihao1@hu= awei.com/ https://lore.kernel.org/patchwork/patch/1250456/ Regards, Markus