lxfb: properly alloc cmap in all cases and don't leak the memory
authorMarco La Porta <marco-laporta@tiscali.it>
Wed, 11 Feb 2009 21:04:20 +0000 (13:04 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Feb 2009 22:25:34 +0000 (14:25 -0800)
commit067f1293cc5916f8d88b602beeb8787d58515608
tree1077d6997716b33ab203ff206e5b7df09ed57d70
parent57f63bc8fe79e6598e7253f10f53f58c9fdc57be
lxfb: properly alloc cmap in all cases and don't leak the memory

We weren't properly allocating the cmap for depths greater than 8bpp,
which caused pain for things like DirectFB.  Also, we never freed the cmap
memory upon module unload..

[dilinger@debian.org: dropped unnecessary code and clean up patch]
[dilinger@debian.org: add error checking and handling]
Signed-off-by: Andres Salomon <dilinger@debian.org>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/geode/lxfb_core.c