PR2039: Fix NULL pointer access

In case rtems_bdbuf_read() returns an error status, the block device
buffer pointer will be set to NULL.  In RFS the chain node of the block
device buffer will be used for RFS purposes.  We must not do this after
an erroneous read.
This commit is contained in:
Sebastian Huber
2012-03-14 09:11:13 +01:00
parent 113944fa63
commit 790f04ddbb
+2 -2
View File
@@ -168,8 +168,6 @@ rtems_rfs_buffer_handle_request (rtems_rfs_file_system* fs,
{
rc = rtems_rfs_buffer_io_request (fs, block, read, &handle->buffer);
rtems_chain_set_off_chain (rtems_rfs_buffer_link(handle));
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
@@ -177,6 +175,8 @@ rtems_rfs_buffer_handle_request (rtems_rfs_file_system* fs,
block, read ? "read" : "get", rc, strerror (rc));
return rc;
}
rtems_chain_set_off_chain (rtems_rfs_buffer_link(handle));
}
/*