This is the mail archive of the
ecos-bugs@sourceware.org
mailing list for the eCos project.
[Bug 1001913] New: Calling restart_rx outside cyg_drv_dsr_lock/unlock in serial_get_config: possibly a race condition?
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: unassigned at bugs dot ecos dot sourceware dot org
- Date: Sun, 10 Nov 2013 18:31:09 +0000
- Subject: [Bug 1001913] New: Calling restart_rx outside cyg_drv_dsr_lock/unlock in serial_get_config: possibly a race condition?
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
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.