diff options
author | Rupesh Gujare <rupesh.gujare@atmel.com> | 2013-08-28 12:43:16 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-28 15:18:40 -0700 |
commit | 8503f9016f01d01b4c3a1e8c9848d4f564e71bd1 (patch) | |
tree | b4d722c564ac4b430a9d88d71558eec8874d86ae /drivers/staging | |
parent | b93d85f007177076c07acd8bf249dc466a977260 (diff) | |
download | op-kernel-dev-8503f9016f01d01b4c3a1e8c9848d4f564e71bd1.zip op-kernel-dev-8503f9016f01d01b4c3a1e8c9848d4f564e71bd1.tar.gz |
staging: ozwpan: Return error, if PD is not connected.
Return error if we receive write(), while PD is not connected.
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/ozwpan/ozcdev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c index 50722ea..6ccb64f 100644 --- a/drivers/staging/ozwpan/ozcdev.c +++ b/drivers/staging/ozwpan/ozcdev.c @@ -162,6 +162,8 @@ static ssize_t oz_cdev_write(struct file *filp, const char __user *buf, spin_unlock_bh(&g_cdev.lock); if (pd == NULL) return -ENXIO; + if (!(pd->state & OZ_PD_S_CONNECTED)) + return -EAGAIN; eb = &pd->elt_buff; ei = oz_elt_info_alloc(eb); if (ei == NULL) { |