public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Rupesh Gujare <rupesh.gujare@atmel.com>
Cc: devel@linuxdriverproject.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org
Subject: Re: [PATCH 4/4] staging: ozwpan: Return error, if PD is not connected.
Date: Tue, 27 Aug 2013 21:27:57 +0400	[thread overview]
Message-ID: <521CE19D.2000805@cogentembedded.com> (raw)
In-Reply-To: <1377618823-12246-4-git-send-email-rupesh.gujare@atmel.com>

Hello.

On 08/27/2013 07:53 PM, Rupesh Gujare wrote:

> Return error if we receive write(), while PD is not connected.

> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
> ---
>   drivers/staging/ozwpan/ozcdev.c |    2 ++
>   1 file changed, 2 insertions(+)

> diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c
> index 03b41ee..22cb2ae 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 -1;

    Note that returning -EPERM here is hardly correct.

> +	if (!(pd->state & OZ_PD_S_CONNECTED))
> +		return -ENXIO;

WBR, Sergei


  reply	other threads:[~2013-08-27 17:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-27 15:53 [PATCH 1/4] staging: ozwpan: Increase ISOC IN buffer depth Rupesh Gujare
2013-08-27 15:53 ` [PATCH 2/4] staging: ozwpan: Reset PORT_ENABLE bit Rupesh Gujare
2013-08-27 15:53 ` [PATCH 3/4] staging: ozwpan: Add debounce time before unregistering Rupesh Gujare
2013-08-27 15:53 ` [PATCH 4/4] staging: ozwpan: Return error, if PD is not connected Rupesh Gujare
2013-08-27 17:27   ` Sergei Shtylyov [this message]
2013-08-27 18:57 ` [PATCH 1/4] staging: ozwpan: Increase ISOC IN buffer depth Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521CE19D.2000805@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rupesh.gujare@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox