From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Date: Thu, 28 Jan 2021 17:52:43 +0200 Subject: [PATCH v2 2/2] console: Don't start/stop console if stdio device invalid In-Reply-To: <20210128131240.13190-3-nsaenzjulienne@suse.de> References: <20210128131240.13190-1-nsaenzjulienne@suse.de> <20210128131240.13190-3-nsaenzjulienne@suse.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Jan 28, 2021 at 02:12:40PM +0100, Nicolas Saenz Julienne wrote: > Don't start/stop an stdio device that might have been already freed. > > Signed-off-by: Nicolas Saenz Julienne > Fixes: 70c2525c0d3c ("IOMUX: Stop dropped consoles") ... > + /* > + * TODO: This is a workaround to avoid accessing freed memory: > + * console_stop() might be called on an stdio_dev that has already been > + * de-registered, due to the fact that stdio_deregister_dev() > + * doesn't update the global console_devices array. > + */ I see now. I think I have experienced this issue from time to time. I will look at it. Tom, Simon, please hold on applying these for a while. > + if (!stdio_valid(sdev)) > + return false; -- With Best Regards, Andy Shevchenko