On 15/09/15(Tue) 04:50, Grant Czajkowski wrote:
> On Fri, Sep 11, 2015 at 02:41:04AM -0600, David Coppa wrote:
> > 
> > Hi!
> > 
> > Repeatedly hit the panic below with latest ugen.c code (v 1.88) and
> > pcsc-lite.
> 
> Thanks for the report.  Could you please try this patch?

ok mpi@

Grant what do you you think about doing an audit of the tree to see if
we're missing this check in other drivers?  I might be interesting to
search bugs@ archives for similar reports.

> Index: ugen.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/ugen.c,v
> retrieving revision 1.88
> diff -u -p -d -r1.88 ugen.c
> --- ugen.c    7 Sep 2015 19:58:42 -0000       1.88
> +++ ugen.c    15 Sep 2015 04:42:02 -0000
> @@ -557,7 +557,9 @@ ugen_do_read(struct ugen_softc *sc, int 
>                           flags, sce->timeout, NULL);
>                       err = usbd_transfer(xfer);
>                       if (err) {
> -                             usbd_clear_endpoint_stall(sce->pipeh);
> +                             if (err == USBD_STALLED)
> +                                     usbd_clear_endpoint_stall(sce->pipeh);
> +
>                               if (err == USBD_INTERRUPTED)
>                                       error = EINTR;
>                               else if (err == USBD_TIMEOUT)
> @@ -691,7 +693,9 @@ ugen_do_write(struct ugen_softc *sc, int
>                           flags, sce->timeout, NULL);
>                       err = usbd_transfer(xfer);
>                       if (err) {
> -                             usbd_clear_endpoint_stall(sce->pipeh);
> +                             if (err == USBD_STALLED)
> +                                     usbd_clear_endpoint_stall(sce->pipeh);
> +
>                               if (err == USBD_INTERRUPTED)
>                                       error = EINTR;
>                               else if (err == USBD_TIMEOUT)
> 

Reply via email to