diff options
author | Diego Nieto Cid <dnietoc@gmail.com> | 2010-11-19 01:13:47 -0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-11-20 22:05:36 +0100 |
commit | f7902eddf30fd6aa62a29f2c9425519f6b01ea66 (patch) | |
tree | 6fbc87e872dd091fba3e334fb39e45c52d5164ed | |
parent | d5541eb74bc59b7c03a80b0ece637411867803bf (diff) |
Avoid accessing invalid memory.
* console/console.c (vcons_lookup): Unlock using cons instead of vcons->cons.
-rw-r--r-- | console/console.c | 6 |
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; } |