Unverified Commit f51dbc4f authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12566 ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event

parents 6941d173 7fc6798d
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -126,15 +126,19 @@ EXPORT_SYMBOL(snd_seq_dump_var_event);
 * expand the variable length event to linear buffer space.
 */

static int seq_copy_in_kernel(char **bufptr, const void *src, int size)
static int seq_copy_in_kernel(void *ptr, void *src, int size)
{
	char **bufptr = ptr;

	memcpy(*bufptr, src, size);
	*bufptr += size;
	return 0;
}

static int seq_copy_in_user(char __user **bufptr, const void *src, int size)
static int seq_copy_in_user(void *ptr, void *src, int size)
{
	char __user **bufptr = ptr;

	if (copy_to_user(*bufptr, src, size))
		return -EFAULT;
	*bufptr += size;
@@ -163,8 +167,7 @@ int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char
		return newlen;
	}
	err = snd_seq_dump_var_event(event,
				     in_kernel ? (snd_seq_dump_func_t)seq_copy_in_kernel :
				     (snd_seq_dump_func_t)seq_copy_in_user,
				     in_kernel ? seq_copy_in_kernel : seq_copy_in_user,
				     &buf);
	return err < 0 ? err : newlen;
}