lkml.org 
[lkml]   [2011]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateThu, 31 Mar 2011 10:58:11 +0100
FromAlan Cox <>
SubjectRe: [PATCH] vt: avoid BUG_ON in con_shutdown when con_open returns with error
O
> +static inline void con_ops_set_shutdown(void);
> static int con_open(struct tty_struct *, struct file *);
> static void vc_init(struct vc_data *vc, unsigned int rows,
> unsigned int cols, int do_clear);
> @@ -2806,6 +2807,14 @@ static int con_open(struct tty_struct *tty,
> struct file *filp) tty->driver_data = vc;
> vc->port.tty = tty;
>
> + /* We must set shutdown only here, otherwise
> + * we returned from con_open with error,
> which
> + * will make tty core call tty_release, that
> + * in its call path makes con_shutdown being
> + * called without tty->driver_data being set,
> + * triggering the BUG_ON there */
> + con_ops_set_shutdown();

No we cannot go around patching the tty_operations - they are not
locked for one.

Probably this is one case where making con_shutdown() check is the
right answer.


\
 
 \ /
  Last update: 2011-03-31 12:19    [from the cache]
©2003-2010