[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT VFS PATCH v2 3/4] Add asserts to fdrop()
Reviewed-by: Costin Lupu <costin.lupu@xxxxxxxxx> On 6/29/19 2:12 PM, Mihai Pogonaru wrote: > We are adding the asserts to be consistent with other > reference releasing functions: drele, vrele. > > Signed-off-by: Mihai Pogonaru <pogonarumihai@xxxxxxxxx> > --- > lib/vfscore/file.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/lib/vfscore/file.c b/lib/vfscore/file.c > index e7627e96..bc8b0dc8 100644 > --- a/lib/vfscore/file.c > +++ b/lib/vfscore/file.c > @@ -42,7 +42,12 @@ > > int fdrop(struct vfscore_file *fp) > { > - int prev = ukarch_dec(&fp->f_count); > + int prev; > + > + UK_ASSERT(fp); > + UK_ASSERT(fp->f_count > 0); > + > + prev = ukarch_dec(&fp->f_count); > > if (prev == 0) > UK_CRASH("Unbalanced fhold/fdrop"); > _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |