]> git.hungrycats.org Git - linux/commitdiff
[PATCH] prevent oops from read of proc entry for tty drivers
authorStephen Hemminger <shemminger@osdl.org>
Tue, 25 Nov 2003 23:01:31 +0000 (15:01 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 25 Nov 2003 23:01:31 +0000 (15:01 -0800)
There are /proc handles there setup by proc_tty_register_driver, but there is
no module ownership association, so anything that reads after module unload
will blow.

The trivial fix is to propagate the owner of tty_driver to proc entry.

fs/proc/proc_tty.c

index f0f93a00ea4c19d75545e7b56fc7ad475ca1b607..df25a6ae0af5372aaf50aada711c07aa7acbf421 100644 (file)
@@ -198,6 +198,7 @@ void proc_tty_register_driver(struct tty_driver *driver)
                return;
        ent->read_proc = driver->read_proc;
        ent->write_proc = driver->write_proc;
+       ent->owner = driver->owner;
        ent->data = driver;
 
        driver->proc_entry = ent;