viafb: Fix various resource leaks during module_init()
commit109771a68bedda77606500dc14455eca92df6769
authorHarald Welte <laforge@gnumonks.org>
Tue, 19 May 2009 09:12:58 +0000 (19 17:12 +0800)
committerJonathan Corbet <corbet@lwn.net>
Tue, 20 Apr 2010 20:23:18 +0000 (20 14:23 -0600)
tree1ab712aaac8db6de0acadc16e14f2cb9595e1746
parent2eaa9cfdf33b8d7fb7aff27792192e0019ae8fc6
viafb: Fix various resource leaks during module_init()

The current code executed from module_init() in viafb does not have
proper error checking and [partial] resoure release paths in case
an error happens half way through driver initialization.

This patch adresses the most obvious of those issues, such as a
leftover i2c bus if module_init (and thus module load) fails.

[jc: fixed merge conflicts]
[jc: also restored -ENOMEM return on ioremap() fail]

Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: ScottFang@viatech.com.cn
Cc: JosephChan@via.com.tw
Signed-off-by: Harald Welte <HaraldWelte@viatech.com>
drivers/video/via/viafbdev.c