Don't forget to initialize `int error' in ttydev_open().
I've had some reports in the past that opening an already opened TTY through, for example, /dev/tty can fail with random error codes. Looking at ttydev_open(), I can see there is a way `error' is returned without initialising it. Even though I haven't had any confirmation this fixes the bug, I'll fix it anyway. Reported by: Andrzej Tobola <ato iem pw edu pl>
This commit is contained in:
parent
3b30175391
commit
dacf7de1a6
@ -204,7 +204,7 @@ static int
|
||||
ttydev_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
|
||||
{
|
||||
struct tty *tp = dev->si_drv1;
|
||||
int error;
|
||||
int error = 0;
|
||||
|
||||
/* Disallow access when the TTY belongs to a different prison. */
|
||||
if (dev->si_cred != NULL &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user