Migrating an object to the global queue in case of an error during
deletion is racy and may paper over potential bugs. Now that the main
reason for this approach is no longer existing (rt_heap/queue_delete
will not return EBUSY anymore), replace the requeueing with basic
consistency checks.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---

 include/native/ppd.h |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/include/native/ppd.h b/include/native/ppd.h
index 3dbda6a..c6e7479 100644
--- a/include/native/ppd.h
+++ b/include/native/ppd.h
@@ -101,19 +101,11 @@ static inline xeno_rholder_t *xeno_get_rholder(void)
                        xnlock_put_irqrestore(&nklock, s);              \
                        obj = rlink2##__name(holder);                   \
                        err = rt_##__name##_delete(obj);                \
+                       XENO_ASSERT(NATIVE, !err || err == -EIDRM, );   \
                        __xeno_trace_release(#__name, obj, err);        \
-                       if (unlikely(err)) {                            \
-                               if ((__rq) != 
&__native_global_rholder.__name##q) { \
-                                       xnlock_get_irqsave(&nklock, s); \
-                                       nholder = popq((rq), holder);   \
-                                       
appendq(&__native_global_rholder.__name##q, holder); \
-                                       obj->rqueue = 
&__native_global_rholder.__name##q; \
-                               }                                       \
-                       } else {                                        \
-                               if (__release)                          \
-                                       __xeno_release_obj(obj);        \
-                               xnlock_get_irqsave(&nklock, s);         \
-                       }                                               \
+                       if (!err && __release)                          \
+                               __xeno_release_obj(obj);                \
+                       xnlock_get_irqsave(&nklock, s);                 \
                }                                                       \
                xnlock_put_irqrestore(&nklock, s);                      \
        } while(0)


_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to