search for: err_foo

Displaying 7 results from an estimated 7 matches for "err_foo".

2016 Aug 22
5
[PATCH] CodingStyle: add some more error handling guidelines
...t is the error that is handled. But it's actually pretty common and IMHO it's a reasonable style provided each error gets 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 symm...
2016 Aug 22
5
[PATCH] CodingStyle: add some more error handling guidelines
...t is the error that is handled. But it's actually pretty common and IMHO it's a reasonable style provided each error gets 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 symm...
2016 Aug 22
4
[PATCH] CodingStyle: add some more error handling guidelines
...y common and IMHO it's a reasonable style > > provided each error gets 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: > > &gt...
2016 Aug 22
4
[PATCH] CodingStyle: add some more error handling guidelines
...y common and IMHO it's a reasonable style > > provided each error gets 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: > > &gt...
2016 Aug 22
0
[PATCH] CodingStyle: add some more error handling guidelines
...t; But it's actually pretty common and IMHO it's a reasonable style > provided each error gets 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); > er...
2016 Aug 23
0
[PATCH] CodingStyle: add some more error handling guidelines
On Tue, Aug 23, 2016 at 01:03:15PM +0200, Bj?rn Mork wrote: > "Michael S. Tsirkin" <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: > > > &...
2016 Aug 23
1
[PATCH] CodingStyle: add some more error handling guidelines
"Michael S. Tsirkin" <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_f...