From: Markus Elfring Date: Thu, 23 Apr 2020 11:10:14 +0000 Subject: Re: [PATCH v1] console: fix an issue about ioremap leak. Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Dejin Zheng , Bartlomiej Zolnierkiewicz , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Coccinelle Cc: =?UTF-8?Q?Thomas_Bogend=c3=b6rfer?= , Florian Tobias Schandinat , Greg Kroah-Hartman , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Ralf_B=c3=a4chle?= , Andy Shevchenko , Thomas Gleixner > if do_take_over_console() return an error in the newport_probe(), > due to the io virtual address is not released, it will cause a leak. How do you think about a wording variant like the following? Subject: [PATCH v2] console: Complete exception handling in newport_probe() Change description: 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 the function “iounmap” together with the check of a failure predicate. I would like to point out that there is a script for the semantic patch language which would detect other questionable source code. https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/scripts/coccinelle/free/iounmap.cocci How do you think about to extend presented software analysis approaches? Regards, Markus