summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2016-08-31 21:02:13 +0900
committerTakashi Iwai <tiwai@suse.de>2016-08-31 14:09:05 +0200
commit4127e80a93e8a4ac009a03a8b0897e89042c7ea0 (patch)
treef78a394e9885467737ff2ee0afc4dbd6d8c1cdf8
parent34b64e5ebffc5e4a9dbf8735561c4159a936248f (diff)
downloadop-kernel-dev-4127e80a93e8a4ac009a03a8b0897e89042c7ea0.zip
op-kernel-dev-4127e80a93e8a4ac009a03a8b0897e89042c7ea0.tar.gz
ALSA: seq: initialize whole fields of automatic variable with union type
Currently, automatic variable of 'union ioctl_arg' type is initialized by designated initialization. Although, the actual effect is interpretation of early element of int type and initialization of 'int pversion'. Therefore the first field corresponding to int type is initialized to zero. This is against my expectation to initialize whole fields. This commit uses memset() to initialize the variable, instead of designated initialization. Fixes: 04a56dd8ed0d ('ALSA: seq: change ioctl command operation to get data in kernel space') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/core/seq/seq_clientmgr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 286394b..811b95b 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -2084,7 +2084,7 @@ static long snd_seq_ioctl(struct file *file, unsigned int cmd,
{
struct snd_seq_client *client = file->private_data;
/* To use kernel stack for ioctl data. */
- union ioctl_arg {
+ union {
int pversion;
int client_id;
struct snd_seq_system_info system_info;
@@ -2100,7 +2100,7 @@ static long snd_seq_ioctl(struct file *file, unsigned int cmd,
struct snd_seq_client_pool client_pool;
struct snd_seq_remove_events remove_events;
struct snd_seq_query_subs query_subs;
- } buf = {0};
+ } buf;
const struct ioctl_handler *handler;
unsigned long size;
int err;
@@ -2114,6 +2114,9 @@ static long snd_seq_ioctl(struct file *file, unsigned int cmd,
}
if (handler->cmd == 0)
return -ENOTTY;
+
+ memset(&buf, 0, sizeof(buf));
+
/*
* All of ioctl commands for ALSA sequencer get an argument of size
* within 13 bits. We can safely pick up the size from the command.
OpenPOWER on IntegriCloud