Displaying 7 results from an estimated 7 matches for "err_bar".
2016 Aug 22
5
[PATCH] CodingStyle: add some more error handling guidelines
...its own label, and each label comes after the
matching cleanup:
foo = kmalloc(SIZE, GFP_KERNEL);
if (!foo)
goto err_foo;
foo->bar = kmalloc(SIZE, GFP_KERNEL);
if (!foo->bar)
goto err_bar;
...
kfree(foo->bar);
err_bar:
kfree(foo);
err_foo:
return ret;
Provides some symmetry and makes it easy to add more cases as code
calling goto does not need to worry about how is the error handled.
Cc: Dan Carp...
2016 Aug 22
5
[PATCH] CodingStyle: add some more error handling guidelines
...its own label, and each label comes after the
matching cleanup:
foo = kmalloc(SIZE, GFP_KERNEL);
if (!foo)
goto err_foo;
foo->bar = kmalloc(SIZE, GFP_KERNEL);
if (!foo->bar)
goto err_bar;
...
kfree(foo->bar);
err_bar:
kfree(foo);
err_foo:
return ret;
Provides some symmetry and makes it easy to add more cases as code
calling goto does not need to worry about how is the error handled.
Cc: Dan Carp...
2016 Aug 22
4
[PATCH] CodingStyle: add some more error handling guidelines
...> foo = kmalloc(SIZE, GFP_KERNEL);
> > if (!foo)
> > goto err_foo;
> >
> > foo->bar = kmalloc(SIZE, GFP_KERNEL);
> > if (!foo->bar)
> > goto err_bar;
> > ...
> >
> > kfree(foo->bar);
> > err_bar:
> >
> > kfree(foo);
> > err_foo:
> >
> > return ret;
>
> Hmm, I've never encountered that style, but...
2016 Aug 22
4
[PATCH] CodingStyle: add some more error handling guidelines
...> foo = kmalloc(SIZE, GFP_KERNEL);
> > if (!foo)
> > goto err_foo;
> >
> > foo->bar = kmalloc(SIZE, GFP_KERNEL);
> > if (!foo->bar)
> > goto err_bar;
> > ...
> >
> > kfree(foo->bar);
> > err_bar:
> >
> > kfree(foo);
> > err_foo:
> >
> > return ret;
>
> Hmm, I've never encountered that style, but...
2016 Aug 22
0
[PATCH] CodingStyle: add some more error handling guidelines
...e
> matching cleanup:
>
> foo = kmalloc(SIZE, GFP_KERNEL);
> if (!foo)
> goto err_foo;
>
> foo->bar = kmalloc(SIZE, GFP_KERNEL);
> if (!foo->bar)
> goto err_bar;
> ...
>
> kfree(foo->bar);
> err_bar:
>
> kfree(foo);
> err_foo:
>
> return ret;
Hmm, I've never encountered that style, but I've never gone looking for it
either. I find it a...
2016 Aug 23
0
[PATCH] CodingStyle: add some more error handling guidelines
...; > foo = kmalloc(SIZE, GFP_KERNEL);
> > if (!foo)
> > goto err_foo;
> >
> > foo->bar = kmalloc(SIZE, GFP_KERNEL);
> > if (!foo->bar)
> > goto err_bar;
> > ...
> >
> > kfree(foo->bar);
> > err_bar:
> >
> > kfree(foo);
> > err_foo:
> >
> > return ret;
>
>
> I believe the CodingStyle already contain far...
2016 Aug 23
1
[PATCH] CodingStyle: add some more error handling guidelines
...;mst at redhat.com> writes:
> foo = kmalloc(SIZE, GFP_KERNEL);
> if (!foo)
> goto err_foo;
>
> foo->bar = kmalloc(SIZE, GFP_KERNEL);
> if (!foo->bar)
> goto err_bar;
> ...
>
> kfree(foo->bar);
> err_bar:
>
> kfree(foo);
> err_foo:
>
> return ret;
I believe the CodingStyle already contain far too much personal style to
be useful as real style guide....