summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4576cde)
raw | patch | inline | side by side (parent: 4576cde)
author | Wendy Liang <jliang@xilinx.com> | |
Thu, 11 Aug 2016 18:44:55 +0000 (11:44 -0700) | ||
committer | Wendy Liang <jliang@xilinx.com> | |
Thu, 13 Oct 2016 05:01:47 +0000 (22:01 -0700) |
Only do rpmsg_retarget if proxy is created.
Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/proxy/rpmsg_retarget.c | patch | blob | history |
index 661876e6df08bc8693df854631351e0bc8f699af..8b6270a85541df8eafaef3529e39c68d362592a7 100644 (file)
* This files contains rpmsg based redefinitions for C RTL system calls
* such as _open, _read, _write, _close.
*************************************************************************/
-static struct _rpc_data *rpc_data;
+static struct _rpc_data *rpc_data = 0;
int send_rpc(void *data, int len);
metal_mutex_deinit(&rpc_data->rpc_lock);
rpmsg_destroy_ept(rpc_data->rp_ept);
env_free_memory(rpc_data);
+ rpc_data = NULL;
return 0;
}
return -1;
}
+ if (!rpc_data)
+ return retval;
+
/* Construct rpc payload */
rpc_data->rpc->id = OPEN_SYSCALL_ID;
rpc_data->rpc->sys_call_args.int_field1 = flags;
if (!buffer || !buflen)
return retval;
+ if (!rpc_data)
+ return retval;
/* Construct rpc payload */
rpc_data->rpc->id = READ_SYSCALL_ID;
if (fd == 1) {
null_term = 1;
}
+ if (!rpc_data)
+ return retval;
rpc_data->rpc->id = WRITE_SYSCALL_ID;
rpc_data->rpc->sys_call_args.int_field1 = fd;
int payload_size = sizeof(struct _sys_rpc);
int retval = -1;
+ if (!rpc_data)
+ return retval;
rpc_data->rpc->id = CLOSE_SYSCALL_ID;
rpc_data->rpc->sys_call_args.int_field1 = fd;
rpc_data->rpc->sys_call_args.int_field2 = 0; /*not used */