]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/macintosh/smu.c: Improve error handling
authorJulia Lawall <julia@diku.dk>
Mon, 23 Jun 2008 18:14:52 +0000 (04:14 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 1 Jul 2008 01:28:17 +0000 (11:28 +1000)
commiteca5bb5c7ae2cbfe3ea4066b98605dc928c04c3e
tree37e228071b05696350bc015f26a5a9270dde927f
parent0c76dfe5b6c031367bf728d78ca54b79357d48a0
drivers/macintosh/smu.c: Improve error handling

This makes two changes:

* As noted by Akinobu Mita in patch
9f40b695c93db287b5444460e0d77178fe4e7dd0, alloc_bootmem never returns NULL
and always returns a zeroed region of memory.  Thus the error checking code
and memset after the call to alloc_bootmem are not necessary.

* The old error handling code consisted of setting a global variable to
NULL and returning an error code, which could cause previously allocated
resources never to be freed.  The patch adds calls to appropriate resource
deallocation functions.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
drivers/macintosh/smu.c