I've pushed my Smatch check for missing error codes. https://github.com/error27/smatch/commit/be18f90f05b684c12b80b9364b5bbc5dbef922da I ended up writing a slightly more tricky version of the check because there were some places that do: ret = 0; goto out; And I didn't want to generate a warning for those. The heuristic is that if "ret" is up to 3 lines before the goto then it's probably intentional. There are still some false positives, especially in fs/ where "ret" is set to zero at the start of the function but it's inentional. I considered doing some more checking to say "this is an error path" but I kind of like it as is. I have a separate unpublished check for "this is an error path and there is a goto but the error code is not set" and I will probably fix that up and publish it as well. So it will be two warnings. :) Or vs And. I've also attached the generated warnings from Friday's linux-next if you want to take a look. regards, dan carpenter