Commit 52123103 authored by Alan Cox's avatar Alan Cox Committed by Steve French

[PATCH] fix security leaks and a crash in es1370

parent f100aab7
......@@ -889,8 +889,8 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
}
if (cmd == SOUND_MIXER_INFO) {
mixer_info info;
strlcpy(info.id, "ES1370", sizeof(info.id));
strlcpy(info.name, "Ensoniq ES1370", sizeof(info.name));
strncpy(info.id, "ES1370", sizeof(info.id));
strncpy(info.name, "Ensoniq ES1370", sizeof(info.name));
info.modify_counter = s->mix.modcnt;
if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT;
......@@ -898,8 +898,8 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
}
if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info;
strlcpy(info.id, "ES1370", sizeof(info.id));
strlcpy(info.name, "Ensoniq ES1370", sizeof(info.name));
strncpy(info.id, "ES1370", sizeof(info.id));
strncpy(info.name, "Ensoniq ES1370", sizeof(info.name));
if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT;
return 0;
......@@ -2484,12 +2484,8 @@ static int es1370_midi_release(struct inode *inode, struct file *file)
break;
if (signal_pending(current))
break;
if (file->f_flags & O_NONBLOCK) {
remove_wait_queue(&s->midi.owait, &wait);
set_current_state(TASK_RUNNING);
unlock_kernel();
return -EBUSY;
}
if (file->f_flags & O_NONBLOCK)
break;
tmo = (count * HZ) / 3100;
if (!schedule_timeout(tmo ? : 1) && tmo)
DBG(printk(KERN_DEBUG "es1370: midi timed out??\n");)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment