diff options
-rw-r--r-- | bmm_lib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -29,12 +29,12 @@ #define pr_debug(fmt, arg...) do { } while(0) #endif -static int bmm_fd = 0; +static int bmm_fd = -1; int bmm_init() { /* attempt to open the BMM driver */ - if(bmm_fd <= 0) + if(bmm_fd < 0) bmm_fd = open(BMM_DEVICE_FILE, O_RDWR); /* if the open failed, try to mount the driver */ @@ -50,9 +50,9 @@ int bmm_init() void bmm_exit() { - if(bmm_fd > 0) + if(bmm_fd >= 0) close(bmm_fd); - bmm_fd = 0; + bmm_fd = -1; } void *bmm_malloc(unsigned long size, int attr) |