On Wed, Jan 29, 2014 at 10:53:07AM -0500, Tejun Heo wrote:
> Hmm... just in case, the code flow is like the following.
> 
>       root = cgroup_root_from_opts(&opts);
>       if (IS_ERR(root)) {
>               ret = PTR_ERR(root);
>               goto out_unlock;
>       }
> 
>       blah blah;
> 
>   out_unlock:
>       unlock stuff;
> 
>       if (ret)
>               return ERR_PTR(ret);
> 
>       deref root;
> 
> Would the static analyzer be able to tell that the above doesn't end
> up derefing an ERR_PTR() value?

Yes.  Smatch understands the implications of the "if (ret) " condition
in this case.

regards,
dan carpenter

_______________________________________________
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild

Reply via email to