]> git.baikalelectronics.ru Git - kernel.git/commit
console: newport_con: fix an issue about leak related system resources
authorDejin Zheng <zhengdejin5@gmail.com>
Thu, 23 Apr 2020 16:42:51 +0000 (00:42 +0800)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Mon, 1 Jun 2020 13:15:20 +0000 (15:15 +0200)
commit37b60f2410616a15c4829deb4310d2eacbcfef49
tree783feacbd387affbfecbaf8d3d99eabac886f0a2
parent9097306eed12ca2cbd6a2c8fa93996fac820407f
console: newport_con: fix an issue about leak related system resources

A call of the function do_take_over_console() can fail here.
The corresponding system resources were not released then.
Thus add a call of iounmap() and release_mem_region()
together with the check of a failure predicate. and also
add release_mem_region() on device removal.

Fixes: cbe83265a0abd ("[PATCH] VT binding: Make newport_con support binding")
Suggested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200423164251.3349-1-zhengdejin5@gmail.com
drivers/video/console/newport_con.c