[FIX]fixing problem of failed second running on redwood_slp
authorKudrjavtsev Nickita <n.kudryavcev@samsung.com>
Fri, 22 Mar 2013 15:31:56 +0000 (19:31 +0400)
committerKudrjavtsev Nickita <n.kudryavcev@samsung.com>
Fri, 22 Mar 2013 15:31:56 +0000 (19:31 +0400)
driver/device_driver.c
driver/storage.h

index 1fe26d1..eaca23d 100644 (file)
@@ -170,7 +170,9 @@ static int device_open(struct inode *inode, struct file *file)
 static int device_release(struct inode *inode, struct file *file)
 {
        gl_nDeviceOpened--;
+       EPRINTF("++ pre module_put");
        module_put(THIS_MODULE);
+       EPRINTF("++ aft module_put");
        return 0;
 }
 
@@ -409,17 +411,21 @@ static long device_ioctl (struct file *file UNUSED, unsigned int cmd, unsigned l
                }
                DPRINTF("Bundle has been copied successfully");
 
-               last_error_buffer_initialize();
+//             last_error_buffer_initialize();
 
-               if (link_bundle() == -1) {
+//             printk(" --++@@ bef lb\n");
+               if (link_bundle() == -1 || has_last_error() == -1) {
                        EPRINTF("Cannot link profile bundle!");
                        result = -1;
                        break;
                }
-               if (has_last_error() == -1) {
-                       EPRINTF("last_error_buffer != NULL");
-                       result = -1;
-               }
+//             printk(" --++@@ bef has_last_error\n");
+//             if (has_last_error() == -1) {
+//                     printk(" --++@@ in if\n");
+//                     DPRINTF("last_error_buffer != NULL");
+//                     result = -1;
+//             }
+//             printk(" --++@@ aft has_last_error\n");
 
                break;
        }
@@ -684,6 +690,7 @@ sad_cleanup:
        case EC_IOCTL_GET_LAST_ERROR:
                {
                        result = get_last_error((void*)arg);
+                       DPRINTF("Get last error buffer");
                        break;
                }
        default:
index 91314d5..4a7a45f 100644 (file)
 #include "probes_manager.h"
 #include "probes.h"
 #include "event_tmpl.h"
+#include "error_storage.h"
 
-extern int update_errno_buffer(const char *buffer);
-extern int get_last_error(void* u_addr);
-extern int has_last_error(void);
-extern void last_error_buffer_initialize(void);
+//extern int update_errno_buffer(const char *buffer);
+//extern int get_last_error(void* u_addr);
+//extern int has_last_error(void);
+//extern void last_error_buffer_initialize(void);
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 extern int EnableContinuousRetrieval(void);