Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7841934ybi; Tue, 9 Jul 2019 05:16:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxCRg86EvKPg8VQrSrqlB442pqO+NtuC8hj/iWLvGaX+qsENhM5oCnJGv7jhcg6OtIGhqD X-Received: by 2002:a17:90a:9b08:: with SMTP id f8mr32698814pjp.103.1562674581667; Tue, 09 Jul 2019 05:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562674581; cv=none; d=google.com; s=arc-20160816; b=ykm25uLhfYnwPb8tcqw+7t2z9Ot1MXB6dbzAmq5+VS/A7HJtMGYpgHtzCmiJDwY2/u xO7MAaIOS7Hwfvk3xqpNo2xkN3HocHVk1I9jqXUCrzrUB2hv3iMgS+kkK0Uul2n7rzSR xBSBLc6y3s9LsOsgOfn5Qzk/RPvGPmgIny48D5QzhXadCoO6/e0mQd2dCv9rwVfwoXlg VoLl9iypA245AHawdmywTSUElT2sKhmf22sBQc+RZS0+wqqVmSsiiqDAnjuTZtY+EZYC VB9tJIhXMT8VFwxSxXEtP5PkB2Si06bUqCT2SZhsCVx8C00KSjZQK35eJF4ORLiv3zCa kgtA== 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:openpgp:from:to:subject:references:cc :dkim-signature; bh=W7QlCD5I5vx/4Lt7+CRVT0d/J/zCjlbQedIPX42Bb8k=; b=0MoXv8wzHHveHmvwHcB6h23fYyQg6mm7xmzr8aMesEberc+h+gi56tEtmE8pIoCwOQ d0L2UMnvlbykzhIGaB9ILGc8XKZSAKJGOmMNvddvJT9v4VzkNo6bxgsjcL9g7yRz6r8q fKEiI6btdAjKmPYijL0YlCjG0cArWSs8pWkJUbB/azYz99ldic/FoZ7dD2S8BJSRcbXI qv+keMWJZ6ZJqEiVpFdFOHAfigfAm0Hboumx/trfsC+BqOttcUXN5JMWTL69/Q0O8Fjb vFYF/wUpoVdn5SJNUwb4uIbEcWhfvJODoqHyDhovDXHuNWssWJRRJfPsTWrvvHDKhssK 7wsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=cLZe3Oqc; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f131si22044320pgc.265.2019.07.09.05.15.59; Tue, 09 Jul 2019 05:16:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=cLZe3Oqc; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726030AbfGIMPa (ORCPT + 99 others); Tue, 9 Jul 2019 08:15:30 -0400 Received: from mout.web.de ([212.227.17.12]:47991 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbfGIMPa (ORCPT ); Tue, 9 Jul 2019 08:15:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1562674493; bh=J1W6SrxrLl8yeccTu58UEmdLYAzUxbW3tx7ueplROWQ=; h=X-UI-Sender-Class:Cc:References:Subject:To:From:Date:In-Reply-To; b=cLZe3Oqc3JxrQJ8lxiY+SYBEMBF/Esrre87QLFEjGwaQLKOW2vE5tEblwR/TgUUm0 PCeMYfBaYsdl4ZhLEHcNsmfrWhVFZH4phoMAwLA8qaTTfJ0uGBunPxy89EIs6illOt wNQT/ITDvC4WJfmiWqQ4nJX+86p5N/A7Q4wtaqbY= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([78.49.179.96]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M9XQB-1hdzFa2GGV-00CyKK; Tue, 09 Jul 2019 14:14:53 +0200 Cc: Allison Randal , Armijn Hemel , Cheng Shengyu , "David S. Miller" , Greg Kroah-Hartman , Herbert Xu , Thomas Gleixner , Xue Zhihong , Yi Wang , linux-crypto@vger.kernel.org, LKML References: <1562566745-7447-2-git-send-email-wen.yang99@zte.com.cn> Subject: Re: Coccinelle: Checking the deletion of duplicate of_node_put() calls with SmPL To: Wen Yang , Julia Lawall , Coccinelle From: Markus Elfring Openpgp: preference=signencrypt 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 jN7YD4Ad724H8fhR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QwykUe+sHRZfAF5TS2YCkQvsyf7vIpSqo/ttDk4+xc Z/wsLiWTgKlih2QYULvW61XU+mWsK8+ZlYUrRMpkauN4CJ5yTpvp+Orcz5KixHQmc5tbkLWf x0n1QFc1xxJhbzN+r9djSGGN/5IBDfUqSANC8cWzHpWaHmSuU3JSAMB/N+yQjIad2ztTckZY pwT6oxng29LzZspTYUEzMz3wK2jQHw+U66qBFk8whA7B2uAU1QdGyPgahLYSOa4XAEGb6wbI FEE= Message-ID: <1c215500-b599-8b2f-61ea-a6f418ab4905@web.de> Date: Tue, 9 Jul 2019 14:14:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1562566745-7447-2-git-send-email-wen.yang99@zte.com.cn> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:mjZt4du5a81zOteXo1CzYRKx+ufI90+1ifPjvzr5kQ7nnfAcAhC UOidXa/z250xX3Cwny3DW50JEtVFhLqcBcKjX6kjTUnpoE26n9y8DErmNoXxS0P6xcTfTxk fceKP/nN8ZcuGSrR8PuCJ8TUOf/TEp2iRkmxznpeSHJ39KJc71R4ow+/crYpe4bVOYqZCC8 TO9IIWQTnXoovi/WujowQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Pgijroxvakk=:QbuqYPIs7U1TD4HvEGqqai QdsYZxniU8iHAv388G1qO23NnZp+BDzdkWXMtxM2xgpPXI2/snb2QRi7sxTdYdBsOEFKkuNSt +JAwsnbAWt9NCTEWWPLrUsjdxeT0TO6tff2Vfu66t2SERC31HaZkDaYTXAQ1nxIjTszO8ePc8 5WO1OxwrRXRXfCZvjVTu1k2D5vh4xJBq1sT6ZpoRZXnMBNnezqeuhdJtK2X6/od0pArSoKiIX gtiUGRsvmtM51JpfhmS87ihhZJtNdtSJdWCU7FV0m9XNLQ5XVgNjhIdLKmk4A5g5r8Axfw8P9 wbPvD4pXaMFBlC4T8/S8X8d7GysVsrpt7MfsRfFBEXMPYRbnsAuJOvn6Np+a08OsK3UvrWfGV WBv3IDX/oLWrPZQVmj3Mp7sb/h5moSEqFs3KJyhe0WQQpqh0veqIcQxquX/CW28xdy8JB66Mh ECpqabbqdJxEOPw/KLxpm/SwQOm/HiX+F8RU3jKPlIMyldkKmfW+MuRwpClqxoxh2V1CHu+rH IgiLtmPXDpy58Onzwtu0YrldJ5HekOdNcvaOWMGKx0nGUSmyCjY2Up1UZuANZ7U+LlvF1FPMr DMpXtmxNtZUF+eJCFKm/Zfv1iX+pGeE8DpOBo8EFmDtILD4lnUviz9+ri9Q2JkxXhpvY7a3Jp JgUvsc2sisOdp45oTWa67D1i3Yqh3ZoqK6cRV3cgevT4ZNrrFOacvDUkVdFbzZZGH/mcWuAv+ PhCwFXiuGkbiWrclofT4LulsBk0eJGVNyZIJgjYHjr4l2G//MO4KiMADqLLp+TlQUHQ+jQrP5 mtd2p7DvZb4QMrSzl8ZUH71BA+hDE5kIDvMNMDBVmp7l3ZJKFRLN0+hZa+Tu/ycVOGb/ByMIH jpfPp6bRw63wMFUZlpy1Gn8WhKBhpwq1RfPTEFHhq+lvanO30EzVMYraHzW4n3K5lVesakGtP tYB+6eZM4iP+f0r4mnq7LX1w9udb+j2Ti3Z+sGPH7CcjifVSAiArubkCpUf4Yg30fomH9WAVZ WZP42BIf7ZR46qg8y/XJlvyGOMuti0FDZePxCzU9tuidTHJAA3QhEcofJvM8FZJqDtb+5cXgY C/ODOtS5TDS575xPD/ge4m4OrVGJF3lHVVA Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org > 110: ierr_out: > 111: of_node_put(trng); ---> double released here > ... > > This issue was detected by using the Coccinelle software. Such a detection of a questionable source code place can be nice and helpf= ul. I constructed another script variant for the semantic patch language. @deletion@ expression x; identifier target; @@ of_node_put(x); if (...) goto target; ... when any target: -of_node_put(x); I observe then that this adjustment approach can generate the desired patc= h for a source code extract. elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch ../janitor/delete_duplic= ate_of_node_put1.cocci crypto4xx_trng-excerpt1.c =E2=80=A6 - of_node_put(trng); =E2=80=A6 But I wonder at the moment why it does not work (as expected) for the orig= inal complete source file. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/dr= ivers/crypto/amcc/crypto4xx_trng.c?id=3D5ad18b2e60b75c7297a998dea702451d33= a052ed#n71 https://elixir.bootlin.com/linux/v5.2/source/drivers/crypto/amcc/crypto4xx= _trng.c#L71 I am curious on further software development ideas. Regards, Markus