2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>

Coverity Id 10
	* libblock/src/bdbuf.c: Rework loop conditional to avoid potential use
	of NULL pointer.
This commit is contained in:
Joel Sherrill
2010-01-19 23:54:17 +00:00
parent c917d31a3f
commit a518defe92
2 changed files with 10 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 10
* libblock/src/bdbuf.c: Rework loop conditional to avoid potential use
of NULL pointer.
2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com> 2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 23 Coverity Id 23

View File

@@ -2253,6 +2253,7 @@ rtems_bdbuf_null_disk_ioctl (rtems_disk_device *dd, uint32_t req, void *arg)
static void static void
rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer) rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
{ {
rtems_chain_node *node;
static rtems_disk_device null_disk = { static rtems_disk_device null_disk = {
.capabilities = 0, .capabilities = 0,
.ioctl = rtems_bdbuf_null_disk_ioctl .ioctl = rtems_bdbuf_null_disk_ioctl
@@ -2301,12 +2302,10 @@ rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
transfer->write_req->status = RTEMS_RESOURCE_IN_USE; transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
transfer->write_req->bufnum = 0; transfer->write_req->bufnum = 0;
while (!rtems_chain_is_empty (&transfer->bds)) while ((node = rtems_chain_get(&transfer->bds)) != NULL)
{ {
rtems_bdbuf_buffer* bd = rtems_bdbuf_buffer* bd = (rtems_bdbuf_buffer*) node;
(rtems_bdbuf_buffer*) rtems_chain_get (&transfer->bds); bool write = false;
bool write = false;
/* /*
* If the device only accepts sequential buffers and this is not the * If the device only accepts sequential buffers and this is not the