From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: smatch: module_init unwinding on errors
Date: Thu, 29 Jul 2010 17:43:29 +0000 [thread overview]
Message-ID: <20100729174329.GU26313@bicker> (raw)
Sort of inspired by Vasiliy's coccinelle work, I wrote a Smatch script to
verify that modules unwind on errors.
http://repo.or.cz/w/smatch.git/blob/HEAD:/check_unwind.c
The heuristic is if you
* call request_irq()
* it possibly succeeded
* you don't call free_irq()
* you're in a function that returns an int
* you are returning non-zero
Then complain.
One question that I had was for, "foo = request_region(bar, size)"
should we call release_region() on "foo" or on "bar"?
regards,
dan carpenter
next reply other threads:[~2010-07-29 17:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-29 17:43 Dan Carpenter [this message]
2010-07-29 18:00 ` smatch: module_init unwinding on errors Randy Dunlap
2010-07-29 20:18 ` Dan Carpenter
2010-08-05 21:19 ` Randy Dunlap
2010-08-06 6:28 ` Julia Lawall
Reply instructions:
You may reply publicly 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100729174329.GU26313@bicker \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.