nusb/cam: fix mistake (nil vs -1)

This commit is contained in:
cinap_lenrek 2022-02-23 18:13:00 +00:00
parent 8bf71adc94
commit 045936a778

View file

@ -278,7 +278,7 @@ err:
if(usbcmd(d, 0x21, SET_CUR, VS_COMMIT_CONTROL << 8, c->iface->id, (uchar *) &c->pc, sizeof(ProbeControl)) < sizeof(ProbeControl)) goto err; if(usbcmd(d, 0x21, SET_CUR, VS_COMMIT_CONTROL << 8, c->iface->id, (uchar *) &c->pc, sizeof(ProbeControl)) < sizeof(ProbeControl)) goto err;
e = selbw(c, &c->pc, d->usb->ep[c->hdr->bEndpointAddress & Epmax]); e = selbw(c, &c->pc, d->usb->ep[c->hdr->bEndpointAddress & Epmax]);
if(e == nil || setalt(c->dev, e->iface) < 0) if(e == nil || setalt(c->dev, e->iface) < 0)
return nil; return -1;
c->ep = openep(d, e); c->ep = openep(d, e);
if(c->ep == nil){ if(c->ep == nil){
setalt(d, c->iface); setalt(d, c->iface);