public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
From: bugzilla-daemon@bugs.ecos.sourceware.org
To: unassigned@bugs.ecos.sourceware.org
Subject: [Bug 1001913] New: Calling restart_rx outside cyg_drv_dsr_lock/unlock in serial_get_config: possibly a race condition?
Date: Sun, 10 Nov 2013 18:33:00 -0000	[thread overview]
Message-ID: <bug-1001913-777@http.bugs.ecos.sourceware.org/> (raw)

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001913

            Bug ID: 1001913
           Summary: Calling restart_rx outside cyg_drv_dsr_lock/unlock in
                    serial_get_config: possibly a race condition?
           Product: eCos
           Version: 3.0
            Target: All
  Architecture/Host All
                OS:
            Status: UNCONFIRMED
          Severity: normal
          Priority: low
         Component: Serial
          Assignee: unassigned@bugs.ecos.sourceware.org
          Reporter: vlad_a_pudovkin@hotmail.com
                CC: ecos-bugs@ecos.sourceware.org

I'm not quite sure this is a bug, but this snippet below seems to be the only
place in the serial IO code where restart_rx (and the data it accesses) is used
outside of the cyg_drv_dsr_lock/unlock pair, which just stood out for me:

// File: packages/io/serial/<version>/src/common/serial.c
// Function: serial_get_config

        * * *
        cyg_drv_dsr_unlock();
        cyg_drv_mutex_unlock(&in_cbuf->lock);
#ifdef CYGPKG_IO_SERIAL_FLOW_CONTROL
        // Restart receiver if it was shutdown
        if ((chan->flow_desc.flags & CYG_SERIAL_FLOW_IN_THROTTLED) != 0) {
            restart_rx( chan, false );
        }
#endif


Wouldn't it be more correct (or at least more consistent) to move this
if-statement right prior to unlocking the DSRs and the mutex? If not, why?

-- 
You are receiving this mail because:
You are the assignee for the bug.


                 reply	other threads:[~2013-11-10 18:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-1001913-777@http.bugs.ecos.sourceware.org/ \
    --to=bugzilla-daemon@bugs.ecos.sourceware.org \
    --cc=unassigned@bugs.ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).