diff mbox

core: Check con_driver is not NULL

Message ID 1447389184-21700-1-git-send-email-sam.mj@au1.ibm.com
State Accepted
Headers show

Commit Message

Sam Mendoza-Jonas Nov. 13, 2015, 4:33 a.m. UTC
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
---
 core/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stewart Smith Nov. 13, 2015, 4:41 a.m. UTC | #1
Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> writes:

> Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
> ---
>  core/console.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/core/console.c b/core/console.c
> index f993237..1cee5da 100644
> --- a/core/console.c
> +++ b/core/console.c
> @@ -292,7 +292,7 @@ ssize_t read(int fd __unused, void *buf, size_t req_count)
>  
>  void flush_console_driver(void)
>  {
> -	if (con_driver->flush != NULL)
> +	if (con_driver && con_driver->flush != NULL)
>  		con_driver->flush();
>  }


everybody should tihnk about how this was found after doing a release on
friday 13th.....
diff mbox

Patch

diff --git a/core/console.c b/core/console.c
index f993237..1cee5da 100644
--- a/core/console.c
+++ b/core/console.c
@@ -292,7 +292,7 @@  ssize_t read(int fd __unused, void *buf, size_t req_count)
 
 void flush_console_driver(void)
 {
-	if (con_driver->flush != NULL)
+	if (con_driver && con_driver->flush != NULL)
 		con_driver->flush();
 }