From f7902eddf30fd6aa62a29f2c9425519f6b01ea66 Mon Sep 17 00:00:00 2001 From: Diego Nieto Cid Date: Fri, 19 Nov 2010 01:13:47 -0300 Subject: Avoid accessing invalid memory. * console/console.c (vcons_lookup): Unlock using cons instead of vcons->cons. --- console/console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'console') diff --git a/console/console.c b/console/console.c index bac9eb8e..0b1f42c4 100644 --- a/console/console.c +++ b/console/console.c @@ -227,7 +227,7 @@ vcons_lookup (cons_t cons, int id, int create, vcons_t *r_vcons) vcons = calloc (1, sizeof (struct vcons)); if (!vcons) { - mutex_unlock (&vcons->cons->lock); + mutex_unlock (&cons->lock); return ENOMEM; } vcons->cons = cons; @@ -244,7 +244,7 @@ vcons_lookup (cons_t cons, int id, int create, vcons_t *r_vcons) { free (vcons->name); free (vcons); - mutex_unlock (&vcons->cons->lock); + mutex_unlock (&cons->lock); return err; } @@ -254,7 +254,7 @@ vcons_lookup (cons_t cons, int id, int create, vcons_t *r_vcons) display_destroy (vcons->display); free (vcons->name); free (vcons); - mutex_unlock (&vcons->cons->lock); + mutex_unlock (&cons->lock); return err; } -- cgit v1.2.3