Coccinelle archive on
 help / color / Atom feed
From: Markus Elfring <>
To: Wen Yang <>,
	Julia Lawall <>,
	Coccinelle <>
Cc: Yi Wang <>,
	Herbert Xu <>,
	Greg Kroah-Hartman <>,
	LKML <>,
	Armijn Hemel <>,,
	Xue Zhihong <>,
	Cheng Shengyu <>,
	Thomas Gleixner <>,
	"David S. Miller" <>,
	Allison Randal <>
Subject: Re: [Cocci] Coccinelle: Checking the deletion of duplicate of_node_put() calls with SmPL
Date: Tue, 9 Jul 2019 14:14:48 +0200
Message-ID: <> (raw)
In-Reply-To: <>

> 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 helpful.

I constructed another script variant for the semantic patch language.

expression x;
identifier target;
 if (...)
    goto target;
 ... when any

I observe then that this adjustment approach can generate the desired patch
for a source code extract.

elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch ../janitor/delete_duplicate_of_node_put1.cocci crypto4xx_trng-excerpt1.c

-	of_node_put(trng);


But I wonder at the moment why it does not work (as expected) for the original
complete source file.

I am curious on further software development ideas.

Cocci mailing list

       reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2019-07-09 12:14 ` Markus Elfring [this message]
2019-07-10  5:55   ` Markus Elfring

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Coccinelle archive on

Archives are clonable:
	git clone --mirror cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ \
	public-inbox-index cocci

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox