summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bmm_lib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bmm_lib.c b/bmm_lib.c
index 073b213..c4d56f6 100644
--- a/bmm_lib.c
+++ b/bmm_lib.c
@@ -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)