[Bug 1650] New: rtems_partition_return_buffer can be called several times

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Aug 3 06:32:08 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1650

           Summary: rtems_partition_return_buffer can be called several
                    times
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: nbkolchin at gmail.com


Created an attachment (id=967)
 --> (https://www.rtems.org/bugzilla/attachment.cgi?id=967)
error testcase.

rtems_partition_return_buffer has no protection for multiple calls:

Sample code:

  rtems_partition_get_buffer(part_id, &buf);
  sc1 = rtems_partition_return_buffer(part_id, buf);
  sc2 = rtems_partition_return_buffer(part_id, buf);

Both sc1 and sc2 are equal to RTEMS_SUCCCESSFUL. Internally partition "memory"
member contains two "buf" inside Chain. And "number_of_used_blocks" is equal to 
-1.

Proposal: Scan "memory" chain to prevent adding buffers that are already inside
chain. I didn't find any standard API for searchin data inside chain.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list