X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/blobdiff_plain/81cf365889e2aa7101b89967263762ae56a0df10..72ce448bf97cfc46f5153468ef5a7e3327ca3673:/usb-driver.c diff --git a/usb-driver.c b/usb-driver.c index d909522..e620145 100644 --- a/usb-driver.c +++ b/usb-driver.c @@ -636,7 +636,10 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) { #ifndef NO_WINDRVR ret = (*ioctl_func) (fd, request, wdioctl); #else - pport->close(cr->hCard); + if (pport) + pport->close(cr->hCard); + + pport = NULL; #endif } break; @@ -890,8 +893,8 @@ int access(const char *pathname, int mode) { if (!func) func = (int (*) (const char*, int)) dlsym(RTLD_NEXT, "access"); - - if (!strcmp(pathname, "/dev/windrvr6")) { + + if (pathname && !strcmp(pathname, "/dev/windrvr6")) { return 0; } else { return (*func)(pathname, mode);