usb: gadget: network: fix bind() error path
[pandora-kernel.git] / drivers / usb / gadget / f_ncm.c
index 4f09500..424fc3d 100644 (file)
@@ -1259,9 +1259,9 @@ fail:
        /* we might as well release our claims on endpoints */
        if (ncm->notify)
                ncm->notify->driver_data = NULL;
-       if (ncm->port.out_ep->desc)
+       if (ncm->port.out_ep)
                ncm->port.out_ep->driver_data = NULL;
-       if (ncm->port.in_ep->desc)
+       if (ncm->port.in_ep)
                ncm->port.in_ep->driver_data = NULL;
 
        ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);