diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-23 12:26:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-23 12:26:32 -0400 |
commit | 5cc0c03823ca18c490f8223f85ed40f2a9d936c4 (patch) | |
tree | a05b7a2a1153efff01a78dc54e2102420e2c29bb /drivers/misc | |
parent | b64194068bbbdef3cc235f5459616a330f3b7724 (diff) | |
parent | b5325a02aa84c794cf520d6d68cae4b150988a32 (diff) |
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/misc')
-rw-r--r-- | drivers/misc/dummy-irq.c | 6 | ||||
-rw-r--r-- | drivers/misc/mei/bus.c | 2 | ||||
-rw-r--r-- | drivers/misc/mei/main.c | 17 |
3 files changed, 15 insertions, 10 deletions
diff --git a/drivers/misc/dummy-irq.c b/drivers/misc/dummy-irq.c index 7014167e2c61..c37eeedfe215 100644 --- a/drivers/misc/dummy-irq.c +++ b/drivers/misc/dummy-irq.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | 21 | ||
22 | static int irq; | 22 | static int irq = -1; |
23 | 23 | ||
24 | static irqreturn_t dummy_interrupt(int irq, void *dev_id) | 24 | static irqreturn_t dummy_interrupt(int irq, void *dev_id) |
25 | { | 25 | { |
@@ -36,6 +36,10 @@ static irqreturn_t dummy_interrupt(int irq, void *dev_id) | |||
36 | 36 | ||
37 | static int __init dummy_irq_init(void) | 37 | static int __init dummy_irq_init(void) |
38 | { | 38 | { |
39 | if (irq < 0) { | ||
40 | printk(KERN_ERR "dummy-irq: no IRQ given. Use irq=N\n"); | ||
41 | return -EIO; | ||
42 | } | ||
39 | if (request_irq(irq, &dummy_interrupt, IRQF_SHARED, "dummy_irq", &irq)) { | 43 | if (request_irq(irq, &dummy_interrupt, IRQF_SHARED, "dummy_irq", &irq)) { |
40 | printk(KERN_ERR "dummy-irq: cannot register IRQ %d\n", irq); | 44 | printk(KERN_ERR "dummy-irq: cannot register IRQ %d\n", irq); |
41 | return -EIO; | 45 | return -EIO; |
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 1e935eacaa7f..9ecd49a7be1b 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c | |||
@@ -496,6 +496,8 @@ int mei_cl_disable_device(struct mei_cl_device *device) | |||
496 | } | 496 | } |
497 | } | 497 | } |
498 | 498 | ||
499 | device->event_cb = NULL; | ||
500 | |||
499 | mutex_unlock(&dev->device_lock); | 501 | mutex_unlock(&dev->device_lock); |
500 | 502 | ||
501 | if (!device->ops || !device->ops->disable) | 503 | if (!device->ops || !device->ops->disable) |
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 7c44c8dbae42..053139f61086 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
@@ -489,11 +489,16 @@ static int mei_ioctl_connect_client(struct file *file, | |||
489 | 489 | ||
490 | /* find ME client we're trying to connect to */ | 490 | /* find ME client we're trying to connect to */ |
491 | i = mei_me_cl_by_uuid(dev, &data->in_client_uuid); | 491 | i = mei_me_cl_by_uuid(dev, &data->in_client_uuid); |
492 | if (i >= 0 && !dev->me_clients[i].props.fixed_address) { | 492 | if (i < 0 || dev->me_clients[i].props.fixed_address) { |
493 | cl->me_client_id = dev->me_clients[i].client_id; | 493 | dev_dbg(&dev->pdev->dev, "Cannot connect to FW Client UUID = %pUl\n", |
494 | cl->state = MEI_FILE_CONNECTING; | 494 | &data->in_client_uuid); |
495 | rets = -ENODEV; | ||
496 | goto end; | ||
495 | } | 497 | } |
496 | 498 | ||
499 | cl->me_client_id = dev->me_clients[i].client_id; | ||
500 | cl->state = MEI_FILE_CONNECTING; | ||
501 | |||
497 | dev_dbg(&dev->pdev->dev, "Connect to FW Client ID = %d\n", | 502 | dev_dbg(&dev->pdev->dev, "Connect to FW Client ID = %d\n", |
498 | cl->me_client_id); | 503 | cl->me_client_id); |
499 | dev_dbg(&dev->pdev->dev, "FW Client - Protocol Version = %d\n", | 504 | dev_dbg(&dev->pdev->dev, "FW Client - Protocol Version = %d\n", |
@@ -527,11 +532,6 @@ static int mei_ioctl_connect_client(struct file *file, | |||
527 | goto end; | 532 | goto end; |
528 | } | 533 | } |
529 | 534 | ||
530 | if (cl->state != MEI_FILE_CONNECTING) { | ||
531 | rets = -ENODEV; | ||
532 | goto end; | ||
533 | } | ||
534 | |||
535 | 535 | ||
536 | /* prepare the output buffer */ | 536 | /* prepare the output buffer */ |
537 | client = &data->out_client_properties; | 537 | client = &data->out_client_properties; |
@@ -543,7 +543,6 @@ static int mei_ioctl_connect_client(struct file *file, | |||
543 | rets = mei_cl_connect(cl, file); | 543 | rets = mei_cl_connect(cl, file); |
544 | 544 | ||
545 | end: | 545 | end: |
546 | dev_dbg(&dev->pdev->dev, "free connect cb memory."); | ||
547 | return rets; | 546 | return rets; |
548 | } | 547 | } |
549 | 548 | ||