Merge branch 'for-linus' of git://git.infradead.org/~dedekind/ubi-2.6
[sfrench/cifs-2.6.git] / kernel / marker.c
index c4c2cd8b61f541f05d60ce934b7b8788f9bdea61..48a4ea5afffde0b758a627fb63046f8a65976ff5 100644 (file)
@@ -61,8 +61,8 @@ struct marker_entry {
        int refcount;   /* Number of times armed. 0 if disarmed. */
        struct rcu_head rcu;
        void *oldptr;
-       char rcu_pending:1;
-       char ptype:1;
+       unsigned char rcu_pending:1;
+       unsigned char ptype:1;
        char name[0];   /* Contains name'\0'format'\0' */
 };
 
@@ -698,14 +698,12 @@ int marker_probe_unregister(const char *name,
 {
        struct marker_entry *entry;
        struct marker_probe_closure *old;
-       int ret = 0;
+       int ret = -ENOENT;
 
        mutex_lock(&markers_mutex);
        entry = get_marker(name);
-       if (!entry) {
-               ret = -ENOENT;
+       if (!entry)
                goto end;
-       }
        if (entry->rcu_pending)
                rcu_barrier();
        old = marker_entry_remove_probe(entry, probe, probe_private);
@@ -713,12 +711,15 @@ int marker_probe_unregister(const char *name,
        marker_update_probes();         /* may update entry */
        mutex_lock(&markers_mutex);
        entry = get_marker(name);
+       if (!entry)
+               goto end;
        entry->oldptr = old;
        entry->rcu_pending = 1;
        /* write rcu_pending before calling the RCU callback */
        smp_wmb();
        call_rcu(&entry->rcu, free_old_closure);
        remove_marker(name);    /* Ignore busy error message */
+       ret = 0;
 end:
        mutex_unlock(&markers_mutex);
        return ret;