Skip to content

Commit b24e7ad

Browse files
committed
ALSA: timer: Fix ioctls for X32 ABI
X32 ABI takes the 64bit timespec, thus the timer user status ioctl becomes incompatible with IA32. This results in NOTTY error when the ioctl is issued. Meanwhile, this struct in X32 is essentially identical with the one in X86-64, so we can just bypassing to the existing code for this specific compat ioctl. Cc: <stable@vger.kernel.org> # v3.4+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 3a72494 commit b24e7ad

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎sound/core/timer_compat.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,21 @@ static int snd_timer_user_status_compat(struct file *file,
8989
return 0;
9090
}
9191

92+
#ifdef CONFIG_X86_X32
93+
/* X32 ABI has the same struct as x86-64 */
94+
#define snd_timer_user_status_x32(file, s) \
95+
snd_timer_user_status(file, s)
96+
#endif /* CONFIG_X86_X32 */
97+
9298
/*
9399
*/
94100

95101
enum {
96102
SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct snd_timer_info32),
97103
SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct snd_timer_status32),
104+
#ifdef CONFIG_X86_X32
105+
SNDRV_TIMER_IOCTL_STATUS_X32 = _IOW('T', 0x14, struct snd_timer_status),
106+
#endif /* CONFIG_X86_X32 */
98107
};
99108

100109
static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
@@ -123,6 +132,10 @@ static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, uns
123132
return snd_timer_user_info_compat(file, argp);
124133
case SNDRV_TIMER_IOCTL_STATUS32:
125134
return snd_timer_user_status_compat(file, argp);
135+
#ifdef CONFIG_X86_X32
136+
case SNDRV_TIMER_IOCTL_STATUS_X32:
137+
return snd_timer_user_status_x32(file, argp);
138+
#endif /* CONFIG_X86_X32 */
126139
}
127140
return -ENOIOCTLCMD;
128141
}

0 commit comments

Comments
 (0)