diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-23 09:26:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-23 09:26:32 -0700 |
commit | 5cc0c03823ca18c490f8223f85ed40f2a9d936c4 (patch) | |
tree | a05b7a2a1153efff01a78dc54e2102420e2c29bb /drivers/char | |
parent | b64194068bbbdef3cc235f5459616a330f3b7724 (diff) | |
parent | b5325a02aa84c794cf520d6d68cae4b150988a32 (diff) | |
download | linux-stable-5cc0c03823ca18c490f8223f85ed40f2a9d936c4.tar.gz linux-stable-5cc0c03823ca18c490f8223f85ed40f2a9d936c4.tar.bz2 linux-stable-5cc0c03823ca18c490f8223f85ed40f2a9d936c4.zip |
Merge tag 'char-misc-3.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg Kroah-Hartman:
"Here are some small char/misc driver fixes for 3.10-rc2.
Nothing major here, just a number of fixes for things that people have
reported, and a MAINTAINERS update for the recent changes for the
hyperv files that went into 3.10-rc1."
* tag 'char-misc-3.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
ttyprintk: Fix NULL pointer deref by setting tty_port ops after initializing port
uio: UIO_DMEM_GENIRQ should depend on HAS_DMA
MAINTAINERS: update Hyper-V file list
mei: bus: Reset event_cb when disabling a device
Drivers: hv: Fix a bug in get_vp_index()
mei: fix out of array access to me clients array
Char: lp, protect LPGETSTATUS with port_mutex
dummy-irq: require the user to specify an IRQ number
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/lp.c | 3 | ||||
-rw-r--r-- | drivers/char/ttyprintk.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/lp.c b/drivers/char/lp.c index dafd9ac6428f..0913d79424d3 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -622,9 +622,12 @@ static int lp_do_ioctl(unsigned int minor, unsigned int cmd, return -EFAULT; break; case LPGETSTATUS: + if (mutex_lock_interruptible(&lp_table[minor].port_mutex)) + return -EINTR; lp_claim_parport_or_block (&lp_table[minor]); status = r_str(minor); lp_release_parport (&lp_table[minor]); + mutex_unlock(&lp_table[minor].port_mutex); if (copy_to_user(argp, &status, sizeof(int))) return -EFAULT; diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c index 4945bd3d18d0..d5d2e4a985aa 100644 --- a/drivers/char/ttyprintk.c +++ b/drivers/char/ttyprintk.c @@ -179,7 +179,6 @@ static int __init ttyprintk_init(void) { int ret = -ENOMEM; - tpk_port.port.ops = &null_ops; mutex_init(&tpk_port.port_write_mutex); ttyprintk_driver = tty_alloc_driver(1, @@ -190,6 +189,7 @@ static int __init ttyprintk_init(void) return PTR_ERR(ttyprintk_driver); tty_port_init(&tpk_port.port); + tpk_port.port.ops = &null_ops; ttyprintk_driver->driver_name = "ttyprintk"; ttyprintk_driver->name = "ttyprintk"; |