diff options
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/compress_offload.c | 6 | ||||
-rw-r--r-- | sound/core/control.c | 19 | ||||
-rw-r--r-- | sound/core/hwdep.c | 4 | ||||
-rw-r--r-- | sound/core/info.c | 4 | ||||
-rw-r--r-- | sound/core/init.c | 2 | ||||
-rw-r--r-- | sound/core/oss/pcm_oss.c | 4 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 8 | ||||
-rw-r--r-- | sound/core/rawmidi.c | 4 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss.c | 4 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_device.h | 2 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_rw.c | 4 | ||||
-rw-r--r-- | sound/core/seq/seq_clientmgr.c | 4 | ||||
-rw-r--r-- | sound/core/timer.c | 4 |
13 files changed, 34 insertions, 35 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 4490a699030b..a12b9555e910 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -396,7 +396,7 @@ static int snd_compr_mmap(struct file *f, struct vm_area_struct *vma) return -ENXIO; } -static inline int snd_compr_get_poll(struct snd_compr_stream *stream) +static __poll_t snd_compr_get_poll(struct snd_compr_stream *stream) { if (stream->direction == SND_COMPRESS_PLAYBACK) return POLLOUT | POLLWRNORM; @@ -404,12 +404,12 @@ static inline int snd_compr_get_poll(struct snd_compr_stream *stream) return POLLIN | POLLRDNORM; } -static unsigned int snd_compr_poll(struct file *f, poll_table *wait) +static __poll_t snd_compr_poll(struct file *f, poll_table *wait) { struct snd_compr_file *data = f->private_data; struct snd_compr_stream *stream; size_t avail; - int retval = 0; + __poll_t retval = 0; if (snd_BUG_ON(!data)) return POLLERR; diff --git a/sound/core/control.c b/sound/core/control.c index 56b3e2d49c82..50fa16022f1f 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -25,6 +25,7 @@ #include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/time.h> +#include <linux/mm.h> #include <linux/sched/signal.h> #include <sound/core.h> #include <sound/minors.h> @@ -1129,7 +1130,7 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf, if (size > 1024 * 128) /* sane value */ return -EINVAL; - container = memdup_user(buf, size); + container = vmemdup_user(buf, size); if (IS_ERR(container)) return PTR_ERR(container); @@ -1137,7 +1138,7 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf, if (!change) change = memcmp(ue->tlv_data, container, size) != 0; if (!change) { - kfree(container); + kvfree(container); return 0; } @@ -1148,7 +1149,7 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf, mask = SNDRV_CTL_EVENT_MASK_INFO; } - kfree(ue->tlv_data); + kvfree(ue->tlv_data); ue->tlv_data = container; ue->tlv_data_size = size; @@ -1197,7 +1198,7 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue) if (ue->info.value.enumerated.names_length > 64 * 1024) return -EINVAL; - names = memdup_user((const void __user *)user_ptrval, + names = vmemdup_user((const void __user *)user_ptrval, ue->info.value.enumerated.names_length); if (IS_ERR(names)) return PTR_ERR(names); @@ -1208,7 +1209,7 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue) for (i = 0; i < ue->info.value.enumerated.items; ++i) { name_len = strnlen(p, buf_len); if (name_len == 0 || name_len >= 64 || name_len == buf_len) { - kfree(names); + kvfree(names); return -EINVAL; } p += name_len + 1; @@ -1225,8 +1226,8 @@ static void snd_ctl_elem_user_free(struct snd_kcontrol *kcontrol) { struct user_element *ue = kcontrol->private_data; - kfree(ue->tlv_data); - kfree(ue->priv_data); + kvfree(ue->tlv_data); + kvfree(ue->priv_data); kfree(ue); } @@ -1666,9 +1667,9 @@ static ssize_t snd_ctl_read(struct file *file, char __user *buffer, return result > 0 ? result : err; } -static unsigned int snd_ctl_poll(struct file *file, poll_table * wait) +static __poll_t snd_ctl_poll(struct file *file, poll_table * wait) { - unsigned int mask; + __poll_t mask; struct snd_ctl_file *ctl; ctl = file->private_data; diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index 8faae3d1455d..26e71cf05f1e 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c @@ -177,7 +177,7 @@ static int snd_hwdep_release(struct inode *inode, struct file * file) return err; } -static unsigned int snd_hwdep_poll(struct file * file, poll_table * wait) +static __poll_t snd_hwdep_poll(struct file * file, poll_table * wait) { struct snd_hwdep *hw = file->private_data; if (hw->ops.poll) @@ -233,8 +233,6 @@ static int snd_hwdep_dsp_load(struct snd_hwdep *hw, /* check whether the dsp was already loaded */ if (hw->dsp_loaded & (1 << info.index)) return -EBUSY; - if (!access_ok(VERIFY_READ, info.image, info.length)) - return -EFAULT; err = hw->ops.dsp_load(hw, &info); if (err < 0) return err; diff --git a/sound/core/info.c b/sound/core/info.c index bcf6a48cc70d..aa86f3f8e056 100644 --- a/sound/core/info.c +++ b/sound/core/info.c @@ -203,11 +203,11 @@ static ssize_t snd_info_entry_write(struct file *file, const char __user *buffer return size; } -static unsigned int snd_info_entry_poll(struct file *file, poll_table *wait) +static __poll_t snd_info_entry_poll(struct file *file, poll_table *wait) { struct snd_info_private_data *data = file->private_data; struct snd_info_entry *entry = data->entry; - unsigned int mask = 0; + __poll_t mask = 0; if (entry->c.ops->poll) return entry->c.ops->poll(entry, diff --git a/sound/core/init.c b/sound/core/init.c index 168ae03d3a1c..8753440c3a6e 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -344,7 +344,7 @@ static int snd_disconnect_release(struct inode *inode, struct file *file) panic("%s(%p, %p) failed!", __func__, inode, file); } -static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait) +static __poll_t snd_disconnect_poll(struct file * file, poll_table * wait) { return POLLERR | POLLNVAL; } diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index e8b19876c420..3ebba9c7f86e 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -2686,10 +2686,10 @@ static int snd_pcm_oss_capture_ready(struct snd_pcm_substream *substream) runtime->oss.period_frames; } -static unsigned int snd_pcm_oss_poll(struct file *file, poll_table * wait) +static __poll_t snd_pcm_oss_poll(struct file *file, poll_table * wait) { struct snd_pcm_oss_file *pcm_oss_file; - unsigned int mask; + __poll_t mask; struct snd_pcm_substream *psubstream = NULL, *csubstream = NULL; pcm_oss_file = file->private_data; diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 484a18d96371..51104df924e1 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -3135,12 +3135,12 @@ static ssize_t snd_pcm_writev(struct kiocb *iocb, struct iov_iter *from) return result; } -static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) +static __poll_t snd_pcm_playback_poll(struct file *file, poll_table * wait) { struct snd_pcm_file *pcm_file; struct snd_pcm_substream *substream; struct snd_pcm_runtime *runtime; - unsigned int mask; + __poll_t mask; snd_pcm_uframes_t avail; pcm_file = file->private_data; @@ -3174,12 +3174,12 @@ static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) return mask; } -static unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait) +static __poll_t snd_pcm_capture_poll(struct file *file, poll_table * wait) { struct snd_pcm_file *pcm_file; struct snd_pcm_substream *substream; struct snd_pcm_runtime *runtime; - unsigned int mask; + __poll_t mask; snd_pcm_uframes_t avail; pcm_file = file->private_data; diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index f055ca10bbc1..fae21311723f 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -1366,11 +1366,11 @@ static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf, return result; } -static unsigned int snd_rawmidi_poll(struct file *file, poll_table * wait) +static __poll_t snd_rawmidi_poll(struct file *file, poll_table * wait) { struct snd_rawmidi_file *rfile; struct snd_rawmidi_runtime *runtime; - unsigned int mask; + __poll_t mask; rfile = file->private_data; if (rfile->input != NULL) { diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c index 8cdf489df80e..5f64d0d88320 100644 --- a/sound/core/seq/oss/seq_oss.c +++ b/sound/core/seq/oss/seq_oss.c @@ -59,7 +59,7 @@ static int odev_release(struct inode *inode, struct file *file); static ssize_t odev_read(struct file *file, char __user *buf, size_t count, loff_t *offset); static ssize_t odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset); static long odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg); -static unsigned int odev_poll(struct file *file, poll_table * wait); +static __poll_t odev_poll(struct file *file, poll_table * wait); /* @@ -197,7 +197,7 @@ static long odev_ioctl_compat(struct file *file, unsigned int cmd, #define odev_ioctl_compat NULL #endif -static unsigned int +static __poll_t odev_poll(struct file *file, poll_table * wait) { struct seq_oss_devinfo *dp; diff --git a/sound/core/seq/oss/seq_oss_device.h b/sound/core/seq/oss/seq_oss_device.h index afa007c0cc2d..2d0e9eaf13aa 100644 --- a/sound/core/seq/oss/seq_oss_device.h +++ b/sound/core/seq/oss/seq_oss_device.h @@ -124,7 +124,7 @@ void snd_seq_oss_release(struct seq_oss_devinfo *dp); int snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long arg); int snd_seq_oss_read(struct seq_oss_devinfo *dev, char __user *buf, int count); int snd_seq_oss_write(struct seq_oss_devinfo *dp, const char __user *buf, int count, struct file *opt); -unsigned int snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait); +__poll_t snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait); void snd_seq_oss_reset(struct seq_oss_devinfo *dp); diff --git a/sound/core/seq/oss/seq_oss_rw.c b/sound/core/seq/oss/seq_oss_rw.c index 6a7b6aceeca9..c538e78ca310 100644 --- a/sound/core/seq/oss/seq_oss_rw.c +++ b/sound/core/seq/oss/seq_oss_rw.c @@ -196,10 +196,10 @@ insert_queue(struct seq_oss_devinfo *dp, union evrec *rec, struct file *opt) * select / poll */ -unsigned int +__poll_t snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait) { - unsigned int mask = 0; + __poll_t mask = 0; /* input */ if (dp->readq && is_read_mode(dp->file_mode)) { diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index d01913404581..b611deef81f5 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -1087,10 +1087,10 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf, /* * handle polling */ -static unsigned int snd_seq_poll(struct file *file, poll_table * wait) +static __poll_t snd_seq_poll(struct file *file, poll_table * wait) { struct snd_seq_client *client = file->private_data; - unsigned int mask = 0; + __poll_t mask = 0; /* check client structures are in place */ if (snd_BUG_ON(!client)) diff --git a/sound/core/timer.c b/sound/core/timer.c index ee09dace8bb1..da05e314917f 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -2072,9 +2072,9 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, return result > 0 ? result : err; } -static unsigned int snd_timer_user_poll(struct file *file, poll_table * wait) +static __poll_t snd_timer_user_poll(struct file *file, poll_table * wait) { - unsigned int mask; + __poll_t mask; struct snd_timer_user *tu; tu = file->private_data; |