ALSA: firewire-lib: use protocol error when detecting wrong value in CIP header
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Fri, 22 May 2015 14:21:14 +0000 (23:21 +0900)
committerTakashi Iwai <tiwai@suse.de>
Sun, 24 May 2015 06:23:58 +0000 (08:23 +0200)
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>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/amdtp.c

index 93cf93a66aed2f98ad57e57fe7408f1a1ce0c5e8..2b3e8b1319f7ce6667583f8a1ebf903186dcf672 100644 (file)
@@ -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;