Re: smatch: module_init unwinding on errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 29 Jul 2010 19:43:29 +0200 Dan Carpenter wrote:

> 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"?

Hi Dan,

Most drivers just use the result of request_region() as a pass/fail indicator.
Only a very few of them actually save the result pointer;  mostly they just pass
bar to release_region().

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux