X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Foss%2Femu10k1%2Fpassthrough.c;h=4e3baca7d41f3d2856accd469e0292d749a07e47;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=805840eb13601bce8b4efee181686ee9525f4216;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/sound/oss/emu10k1/passthrough.c b/sound/oss/emu10k1/passthrough.c index 805840eb1..4e3baca7d 100644 --- a/sound/oss/emu10k1/passthrough.c +++ b/sound/oss/emu10k1/passthrough.c @@ -131,7 +131,7 @@ int emu10k1_pt_setup(struct emu10k1_wavedevice *wave_dev) return 0; } -ssize_t emu10k1_pt_write(struct file *file, const char *buffer, size_t count) +ssize_t emu10k1_pt_write(struct file *file, const char __user *buffer, size_t count) { struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data; struct emu10k1_card *card = wave_dev->card; @@ -177,10 +177,9 @@ ssize_t emu10k1_pt_write(struct file *file, const char *buffer, size_t count) blocks = (count-bytes_copied)/PT_BLOCKSIZE; blocks_copied = 0; while (blocks > 0) { - u16 *bufptr = (u16 *) buffer + (bytes_copied/2); + u16 __user *bufptr = (u16 __user *) buffer + (bytes_copied/2); copy_from_user(pt->buf, bufptr, PT_BLOCKSIZE); - bufptr = (u16 *) pt->buf; - r = pt_putblock(wave_dev, bufptr, nonblock); + r = pt_putblock(wave_dev, (u16 *)pt->buf, nonblock); if (r) { if (bytes_copied) return bytes_copied; @@ -214,8 +213,7 @@ void emu10k1_pt_stop(struct emu10k1_card *card) sblive_writeptr(card, SPCS0 + i, 0, pt->old_spcs[i]); } pt->state = PT_STATE_INACTIVE; - if(pt->buf) - kfree(pt->buf); + kfree(pt->buf); } }