diff options
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -115,9 +115,12 @@ int hello_read_procmem(char *page, char **start, off_t off, int count, int *eof, struct hello_dev *dev = (struct hello_dev *) data; - len = sprintf(page, "hello module internal buffer is at: %p, with index of: %lu, " - "buffer starts with: %c\n", dev->hello_buffer, dev->buff_index, - dev->hello_buffer[0]); + if (down_interruptible(&dev->sem)) /* protects page buffer from multiple writes */ + return -ERESTARTSYS; + len = sprintf(page, "hello module internal buffer is at: %p, with size of: %lu, " + "buffer starts with: %c\n", dev->mylist, dev->ll_size, + dev->mylist ? dev->mylist->chunk[0] : '0'); + up(&dev->sem); *eof = 1; /* signify that we're done with dumping our internal structure */ |