All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: clemens@ladisch.de, tiwai@suse.de
Cc: alsa-devel@alsa-project.org
Subject: [PATCH 4/4] ALSA: firewire-lib: use protocol error when detecting wrong value in CIP header
Date: Fri, 22 May 2015 23:21:14 +0900	[thread overview]
Message-ID: <1432304474-6533-5-git-send-email-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <1432304474-6533-1-git-send-email-o-takashi@sakamocchi.jp>

When detecting zero in 'dbs' field of CIP header, this packet streaming
should be aborted because of avoiding division-by-zero. This is an error
in an aspect of IEC 61883-1, thus protocol error.

This commit use EPROTO instead of EIO. Actually, the returned value is
not used for userspace and this commit has no effect.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/amdtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 93cf93a..2b3e8b1 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -726,7 +726,7 @@ static int handle_in_packet(struct amdtp_stream *s,
 			dev_err(&s->unit->device,
 				"Detect invalid value in dbs field: %08X\n",
 				cip_header[0]);
-			return -EIO;
+			return -EPROTO;
 		}
 		if (s->flags & CIP_WRONG_DBS)
 			data_block_quadlets = s->data_block_quadlets;
-- 
2.1.4

  parent reply	other threads:[~2015-05-22 14:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 14:21 [PATCH 0/4] ALSA: firewire-lib: code cleanup Takashi Sakamoto
2015-05-22 14:21 ` [PATCH 1/4] ALSA: firewire-lib: rename local functions for " Takashi Sakamoto
2015-05-22 14:21 ` [PATCH 2/4] ALSA: firewire-lib: macro arrangement " Takashi Sakamoto
2015-05-22 14:21 ` [PATCH 3/4] ALSA: firewire-lib: use dev_err() when detecting incoming streaming error Takashi Sakamoto
2015-05-22 15:08   ` Takashi Iwai
2015-05-22 18:05   ` Clemens Ladisch
2015-05-23  4:16     ` Takashi Sakamoto
2015-05-23  7:00       ` Takashi Sakamoto
2015-05-22 14:21 ` Takashi Sakamoto [this message]
2015-05-23 19:16 ` [PATCH 0/4] ALSA: firewire-lib: code cleanup Clemens Ladisch
2015-05-24  6:35 ` Takashi Iwai
2015-05-24 11:41   ` Takashi Sakamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432304474-6533-5-git-send-email-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.