diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-08-12 08:26:43 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-08-12 08:26:43 +0000 |
commit | ea093c833f07cf2166bb61f1f00ddb2289ac865b (patch) | |
tree | 9e244e9e21437b087abbec65980b48be1f964b7a /sys | |
parent | c23a5a791abbd7ac1554e4f76a946f456204c775 (diff) |
Don't process xfers which have the stream error bit set in the stream
header.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/uvideo.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index e93139b6a5d..e07a6aa2e47 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.79 2008/08/11 05:37:01 mglocker Exp $ */ +/* $OpenBSD: uvideo.c,v 1.80 2008/08/12 08:26:42 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -1397,6 +1397,7 @@ uvideo_vs_cb(usbd_xfer_handle xfer, usbd_private_handle priv, struct uvideo_softc *sc = vs->sc; int len, i, frame_size; uint8_t *frame; + usbd_status error; DPRINTF(2, "%s: %s\n", DEVNAME(sc), __func__); @@ -1419,7 +1420,9 @@ uvideo_vs_cb(usbd_xfer_handle xfer, usbd_private_handle priv, /* frame is empty */ continue; - (void)uvideo_vs_decode_stream_header(sc, frame, frame_size); + error = uvideo_vs_decode_stream_header(sc, frame, frame_size); + if (error == USBD_CANCELLED) + break; } skip: /* setup new transfer */ @@ -1450,6 +1453,11 @@ uvideo_vs_decode_stream_header(struct uvideo_softc *sc, uint8_t *frame, /* stream header without payload and no EOF */ return (USBD_INVAL); } + if (header_flags & UVIDEO_STREAM_ERR) { + /* stream error, skip xfer */ + DPRINTF(1, "%s: %s: stream error!\n", DEVNAME(sc), __func__); + return (USBD_CANCELLED); + } DPRINTF(2, "%s: frame_size = %d\n", DEVNAME(sc), frame_size); |