Browse Source

ALSA: firewire-lib: use protocol error when detecting wrong value in CIP header

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>
Takashi Sakamoto 10 năm trước cách đây
mục cha
commit
a900705491
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      sound/firewire/amdtp.c

+ 1 - 1
sound/firewire/amdtp.c

@@ -726,7 +726,7 @@ static int handle_in_packet(struct amdtp_stream *s,
 			dev_err(&s->unit->device,
 			dev_err(&s->unit->device,
 				"Detect invalid value in dbs field: %08X\n",
 				"Detect invalid value in dbs field: %08X\n",
 				cip_header[0]);
 				cip_header[0]);
-			return -EIO;
+			return -EPROTO;
 		}
 		}
 		if (s->flags & CIP_WRONG_DBS)
 		if (s->flags & CIP_WRONG_DBS)
 			data_block_quadlets = s->data_block_quadlets;
 			data_block_quadlets = s->data_block_quadlets;