logfs: testing the wrong variable
PATCH 1/1 logfs: testing the wrong variable
There is a typo here. We should test "last" instead of "first".
fs/logfs/super.c +1 -1
@@ -377,7 +377,7 @@ static struct page *find_super_block(struct super_block *sb)if (!first ||IS_ERR (first))return NULL ; last = super->s_devops->find_last_sb (sb, &super->s_sb_ofs[1 ]); -if (!last ||IS_ERR (first)) { +if (!last ||IS_ERR (last)) {page_cache_release (first);return NULL ; }
Jörn Engel
AppliedQuoted 10 lines · Dan Carpenter
There is a typo here. We should test "last" instead of "first".
Signed-off-by Dan Carpenter <[email protected]>fs/logfs/super.c +0
-0
fs/logfs/super.c static struct page *find_super_block(struct super_block *sb) · line 383
Quoted 8 lines
fs/logfs/super.c +1
-1@@ -377,7 +377,7 @@ static struct page *find_super_block(struct super_block *sb)if (!first ||IS_ERR (first))return NULL ; last = super->s_devops->find_last_sb (sb, &super->s_sb_ofs[1 ]); -if (!last ||IS_ERR (first)) { +if (!last ||IS_ERR (last)) {page_cache_release (first);return NULL ; }
Applied, thanks!
Did you use a tool to find this? And if yes, where would I find it? ;)
Jörn
Signature · 9 lines
In America you can have either a flimsy box banged together out of two by fours and drywall, or a McMansion -- a flimsy box banged together out of two by fours and drywall, but larger, more dramatic-looking, and full of expensive fittings. -- Paul Graham -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 2 lines · Jörn Engel
Did you use a tool to find this? And if yes, where would I find it? ;)
This is smatch stuff (http://smatch.sf.net).
The problem is that it's a private modification where I made it print errors if we pass an ERR_PTR to a function. After I send out 10 patches today that modification will only print false positives... Normally the false positives are cases where the function accepts ERR_PTRs as a paramater. I need to kill most of the false positives before I can push the change.
The good thing about Smatch is that it's easy to compile, but the bad thing is that it's false positive heavy.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 14 lines · Dan Carpenter
Quoted 2 lines · Jörn Engel
Did you use a tool to find this? And if yes, where would I find it? ;)
This is smatch stuff (http://smatch.sf.net).
The problem is that it's a private modification where I made it print errors if we pass an
ERR_PTRto a function. After I send out 10 patches today that modification will only print false positives... Normally the false positives are cases where the function acceptsERR_PTRsas a paramater. I need to kill most of the false positives before I can push the change.
Quoted 2 lines
The good thing about Smatch is that it's easy to compile, but the bad thing is that it's false positive heavy.
:)
I'll need to take a closer look sometime. Years back I wrote a callgraph generator based on smatch. Goal was to calculate the max stack consumption across the complete kernel, but it can be used for other purposes as well. I remember having to patch gcc 3.1 as part of the exercise, so obviously the code has bitrotted since and needs some care.
Jörn
Signature · 3 lines
Never argue with idiots - first they drag you down to their level, then they beat you with experience. -- unknown