diff options
author | Juan Gutierrez <jgutierrez@ti.com> | 2012-05-17 12:53:34 -0500 |
---|---|---|
committer | Dmytro Kedrovskyi <x0169235@ti.com> | 2012-05-21 20:26:00 +0300 |
commit | 6eb994a6c129c018146f77d3159768c0a8c8ea27 (patch) | |
tree | cb8a6e526733f22da7e4d45517e9525f35ad67e8 /drivers/rpmsg | |
parent | c19baf4ee9ff0e602e5957bf949488d2992bac53 (diff) | |
download | kernel_samsung_espresso10-6eb994a6c129c018146f77d3159768c0a8c8ea27.zip kernel_samsung_espresso10-6eb994a6c129c018146f77d3159768c0a8c8ea27.tar.gz kernel_samsung_espresso10-6eb994a6c129c018146f77d3159768c0a8c8ea27.tar.bz2 |
rpmsg: omx: initialize completion event in rpmsg_omx_open
An omx object is created when opening the rpmsg-omx device. However
the "reply_arrived" completion event is not initialized until the
connection message is sent across.
When the rpmsg_omx driver is removed (like in recovery), all pending
threads waiting on the "reply_arrived" are unblocked by a complete_all
call, however, if the rpmsg-omx device was only opened, such event is
not initialized yet, so the complete_all call will dereference a null
object causing a panic.
This patch moves the initialization of the "reply_arrived" completion
event to the open call, after the allocation of the omx object.
Change-Id: I92cf9cf5ac748456cb43bedc88fe1a8d80addd6c
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r-- | drivers/rpmsg/rpmsg_omx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rpmsg/rpmsg_omx.c b/drivers/rpmsg/rpmsg_omx.c index 9503481..b49ff30 100644 --- a/drivers/rpmsg/rpmsg_omx.c +++ b/drivers/rpmsg/rpmsg_omx.c @@ -330,8 +330,6 @@ static int rpmsg_omx_connect(struct rpmsg_omx_instance *omx, char *omxname) payload = (struct omx_conn_req *)hdr->data; strcpy(payload->name, omxname); - init_completion(&omx->reply_arrived); - /* send a conn req to the remote OMX connection service. use * the new local address that was just allocated by ->open */ ret = rpmsg_send_offchannel(omxserv->rpdev, omx->ept->addr, @@ -474,6 +472,8 @@ static int rpmsg_omx_open(struct inode *inode, struct file *filp) "rpmsg-omx"); #endif + init_completion(&omx->reply_arrived); + /* associate filp with the new omx instance */ filp->private_data = omx; mutex_lock(&omxserv->lock); |