summaryrefslogtreecommitdiff
path: root/console
diff options
context:
space:
mode:
authorDiego Nieto Cid <dnietoc@gmail.com>2010-11-19 01:13:47 -0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-11-20 22:05:36 +0100
commitf7902eddf30fd6aa62a29f2c9425519f6b01ea66 (patch)
tree6fbc87e872dd091fba3e334fb39e45c52d5164ed /console
parentd5541eb74bc59b7c03a80b0ece637411867803bf (diff)
Avoid accessing invalid memory.
* console/console.c (vcons_lookup): Unlock using cons instead of vcons->cons.
Diffstat (limited to 'console')
-rw-r--r--console/console.c6
1 files changed, 3 insertions, 3 deletions
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;
}