Re: [PATCH] befs: fix return value check in befs_iget()

From: Dan Carpenter
Date: Wed Oct 30 2013 - 14:29:35 EST


On Wed, Oct 30, 2013 at 10:52:38AM -0700, Kees Cook wrote:
> On Mon, Oct 28, 2013 at 7:00 PM, Wei Yongjun <weiyj.lk@xxxxxxxxx> wrote:
> > From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
> >
> > In case of error, the function iget_locked() returns NULL pointer
> > not ERR_PTR(). The IS_ERR() test in the return value check should
> > be replaced with NULL test.
> >
> > Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
>
> Good catch, thanks!
>
> Acked-by: Kees Cook <keescook@xxxxxxxxxxxx>
>
> As an aside, Dan, how hard would this kind of mismatch be to detect
> with smatch?

It already does, but you need the cross function database set up.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/