From e57421f400d17786c1fdbead5fbca27a1fbe4ec5 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 22 May 2009 10:50:30 -0500 Subject: Added error checking and other updates. * runtime/vsprintf.c: Added transport.h inclusion for STP_BUFFER_SIZE definition. * runtime/transport/debugfs.c (_stp_register_ctl_channel_fs): Added error checking. * runtime/transport/transport.c (_stp_get_root_dir): Ditto. (_stp_transport_fs_init): Added original transport support and error checking. * runtime/transport/relay_v2.c (__stp_relay_create_buf_file_callback): Added error checking. (_stp_transport_data_fs_init): Ditto. * runtime/transport/ring_buffer.c (_stp_transport_data_fs_init): Ditto. * runtime/transport/utt.c: Removed unused file. * runtime/transport/utt.h: Ditto. --- runtime/transport/relay_v2.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'runtime/transport/relay_v2.c') diff --git a/runtime/transport/relay_v2.c b/runtime/transport/relay_v2.c index c0a772ed..0c8d0955 100644 --- a/runtime/transport/relay_v2.c +++ b/runtime/transport/relay_v2.c @@ -204,7 +204,10 @@ __stp_relay_create_buf_file_callback(const char *filename, { struct dentry *file = debugfs_create_file(filename, mode, parent, buf, &relay_file_operations); - if (file) { + if (IS_ERR(file)) { + file = NULL; + } + else if (file) { file->d_inode->i_uid = _stp_uid; file->d_inode->i_gid = _stp_gid; } @@ -251,6 +254,12 @@ static int _stp_transport_data_fs_init(void) rc = -EIO; goto err; } + else if (IS_ERR(_stp_relay_data.dropped_file)) { + rc = PTR_ERR(_stp_relay_data.dropped_file); + _stp_relay_data.dropped_file = NULL; + goto err; + } + _stp_relay_data.dropped_file->d_inode->i_uid = _stp_uid; _stp_relay_data.dropped_file->d_inode->i_gid = _stp_gid; -- cgit