Commit 8643b8ce authored by Ravindra Lokhande's avatar Ravindra Lokhande Committed by Stefan Bader

ALSA: compress: add support for 32bit calls in a 64bit kernel

BugLink: https://bugs.launchpad.net/bugs/1826212

commit c1036889 upstream.

Compress offload does not support ioctl calls from a 32bit userspace
in a 64 bit kernel. This patch adds support for ioctls from a 32bit
userspace in a 64bit kernel
Signed-off-by: default avatarRavindra Lokhande <rlokhande@nvidia.com>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 39ec3016
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/uio.h> #include <linux/uio.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/compat.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/initval.h> #include <sound/initval.h>
#include <sound/compress_params.h> #include <sound/compress_params.h>
...@@ -859,6 +860,15 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg) ...@@ -859,6 +860,15 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
return retval; return retval;
} }
/* support of 32bit userspace on 64bit platforms */
#ifdef CONFIG_COMPAT
static long snd_compr_ioctl_compat(struct file *file, unsigned int cmd,
unsigned long arg)
{
return snd_compr_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
}
#endif
static const struct file_operations snd_compr_file_ops = { static const struct file_operations snd_compr_file_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = snd_compr_open, .open = snd_compr_open,
...@@ -866,6 +876,9 @@ static const struct file_operations snd_compr_file_ops = { ...@@ -866,6 +876,9 @@ static const struct file_operations snd_compr_file_ops = {
.write = snd_compr_write, .write = snd_compr_write,
.read = snd_compr_read, .read = snd_compr_read,
.unlocked_ioctl = snd_compr_ioctl, .unlocked_ioctl = snd_compr_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = snd_compr_ioctl_compat,
#endif
.mmap = snd_compr_mmap, .mmap = snd_compr_mmap,
.poll = snd_compr_poll, .poll = snd_compr_poll,
}; };
......
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