X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fcore%2Fseq%2Fseq_clientmgr.c;h=4b24a1fbc9897a78bf4c8e433a29c3ab4e2ed704;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=b30fda808264d91ea4002a3ded988c1ee5caed07;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index b30fda808..4b24a1fbc 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -420,7 +420,10 @@ static ssize_t snd_seq_read(struct file *file, char __user *buf, size_t count, l count -= err; buf += err; } else { - copy_to_user(buf, &cell->event, sizeof(snd_seq_event_t)); + if (copy_to_user(buf, &cell->event, sizeof(snd_seq_event_t))) { + err = -EFAULT; + break; + } count -= sizeof(snd_seq_event_t); buf += sizeof(snd_seq_event_t); } @@ -748,8 +751,8 @@ static int multicast_event(client_t *client, snd_seq_event_t *event, * n == 0 : the event was not passed to any client. * n < 0 : error - event was not processed. */ -int snd_seq_deliver_event(client_t *client, snd_seq_event_t *event, - int atomic, int hop) +static int snd_seq_deliver_event(client_t *client, snd_seq_event_t *event, + int atomic, int hop) { int result; @@ -901,7 +904,7 @@ static int snd_seq_client_enqueue_event(client_t *client, return -ENXIO; /* queue is not allocated */ /* allocate an event cell */ - err = snd_seq_event_dup(client->pool, event, &cell, !blocking && !atomic, file); + err = snd_seq_event_dup(client->pool, event, &cell, !blocking || atomic, file); if (err < 0) return err;