Skip to content

Commit

Permalink
Merge tag 'char-misc-3.10-rc2' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Linus Torvalds committed May 23, 2013
2 parents b641940 + b5325a0 commit 5cc0c03
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 13 deletions.
9 changes: 8 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3865,9 +3865,16 @@ M: K. Y. Srinivasan <kys@microsoft.com>
M: Haiyang Zhang <haiyangz@microsoft.com>
L: devel@linuxdriverproject.org
S: Maintained
F: drivers/hv/
F: arch/x86/include/asm/mshyperv.h
F: arch/x86/include/uapi/asm/hyperv.h
F: arch/x86/kernel/cpu/mshyperv.c
F: drivers/hid/hid-hyperv.c
F: drivers/hv/
F: drivers/net/hyperv/
F: drivers/scsi/storvsc_drv.c
F: drivers/video/hyperv_fb.c
F: include/linux/hyperv.h
F: tools/hv/

I2C OVER PARALLEL PORT
M: Jean Delvare <khali@linux-fr.org>
Expand Down
3 changes: 3 additions & 0 deletions drivers/char/lp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/ttyprintk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion drivers/hv/channel_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static u32 get_vp_index(uuid_le *type_guid)
return 0;
}
cur_cpu = (++next_vp % max_cpus);
return cur_cpu;
return hv_context.vp_index[cur_cpu];
}

/*
Expand Down
6 changes: 5 additions & 1 deletion drivers/misc/dummy-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <linux/irq.h>
#include <linux/interrupt.h>

static int irq;
static int irq = -1;

static irqreturn_t dummy_interrupt(int irq, void *dev_id)
{
Expand All @@ -36,6 +36,10 @@ static irqreturn_t dummy_interrupt(int irq, void *dev_id)

static int __init dummy_irq_init(void)
{
if (irq < 0) {
printk(KERN_ERR "dummy-irq: no IRQ given. Use irq=N\n");
return -EIO;
}
if (request_irq(irq, &dummy_interrupt, IRQF_SHARED, "dummy_irq", &irq)) {
printk(KERN_ERR "dummy-irq: cannot register IRQ %d\n", irq);
return -EIO;
Expand Down
2 changes: 2 additions & 0 deletions drivers/misc/mei/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ int mei_cl_disable_device(struct mei_cl_device *device)
}
}

device->event_cb = NULL;

mutex_unlock(&dev->device_lock);

if (!device->ops || !device->ops->disable)
Expand Down
17 changes: 8 additions & 9 deletions drivers/misc/mei/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,16 @@ static int mei_ioctl_connect_client(struct file *file,

/* find ME client we're trying to connect to */
i = mei_me_cl_by_uuid(dev, &data->in_client_uuid);
if (i >= 0 && !dev->me_clients[i].props.fixed_address) {
cl->me_client_id = dev->me_clients[i].client_id;
cl->state = MEI_FILE_CONNECTING;
if (i < 0 || dev->me_clients[i].props.fixed_address) {
dev_dbg(&dev->pdev->dev, "Cannot connect to FW Client UUID = %pUl\n",
&data->in_client_uuid);
rets = -ENODEV;
goto end;
}

cl->me_client_id = dev->me_clients[i].client_id;
cl->state = MEI_FILE_CONNECTING;

dev_dbg(&dev->pdev->dev, "Connect to FW Client ID = %d\n",
cl->me_client_id);
dev_dbg(&dev->pdev->dev, "FW Client - Protocol Version = %d\n",
Expand Down Expand Up @@ -527,11 +532,6 @@ static int mei_ioctl_connect_client(struct file *file,
goto end;
}

if (cl->state != MEI_FILE_CONNECTING) {
rets = -ENODEV;
goto end;
}


/* prepare the output buffer */
client = &data->out_client_properties;
Expand All @@ -543,7 +543,6 @@ static int mei_ioctl_connect_client(struct file *file,
rets = mei_cl_connect(cl, file);

end:
dev_dbg(&dev->pdev->dev, "free connect cb memory.");
return rets;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/uio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ config UIO_PDRV_GENIRQ

config UIO_DMEM_GENIRQ
tristate "Userspace platform driver with generic irq and dynamic memory"
depends on HAS_DMA
help
Platform driver for Userspace I/O devices, including generic
interrupt handling code. Shared interrupts are not supported.
Expand Down

0 comments on commit 5cc0c03

Please sign in to comment.