Commit 79576cf2 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] janitor: fix oss/harmony copy*user

This patch catches insures proper return values from
copy_to/from_user calls.

From: Ron Gage <ron@rongage.org>
parent 8f6b1f62
......@@ -725,7 +725,7 @@ static int harmony_audio_ioctl(struct inode *inode,
info.fragments = MAX_BUFS - harmony.nb_filled_play;
info.fragsize = HARMONY_BUF_SIZE;
info.bytes = info.fragments * info.fragsize;
return copy_to_user((void *)arg, &info, sizeof(info));
return copy_to_user((void *)arg, &info, sizeof(info)) ? -EFAULT : 0;
case SNDCTL_DSP_GETISPACE:
if (!(file->f_mode & FMODE_READ))
......@@ -734,7 +734,7 @@ static int harmony_audio_ioctl(struct inode *inode,
info.fragments = /*MAX_BUFS-*/ harmony.nb_filled_record;
info.fragsize = HARMONY_BUF_SIZE;
info.bytes = info.fragments * info.fragsize;
return copy_to_user((void *)arg, &info, sizeof(info));
return copy_to_user((void *)arg, &info, sizeof(info)) ? -EFAULT : 0;
case SNDCTL_DSP_SYNC:
return 0;
......
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