[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130401193721.GA13712@kroah.com>
Date: Mon, 1 Apr 2013 12:37:21 -0700
From: Greg KH <gregkh@...uxfoundation.org>
To: Chen Gang <gang.chen@...anux.com>
Cc: jhovold@...il.com, Jiri Slaby <jslaby@...e.cz>,
mferrell@...ogix.com,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: USB: mos7840: looping issue: avoid the return value overriden by
looping
On Mon, Apr 01, 2013 at 11:50:55AM +0800, Chen Gang wrote:
>
> inside the 'for' looping:
> the return value 'rv' may override if not have a check in time.
>
> next checking, outside the 'for' looping:
> can not find failure which generated during the 'for' looping
>
> so need let outside know about the failure.
>
>
> Signed-off-by: Chen Gang <gang.chen@...anux.com>
> ---
> drivers/usb/serial/mos7840.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
> index a0d5ea5..13aae1e 100644
> --- a/drivers/usb/serial/mos7840.c
> +++ b/drivers/usb/serial/mos7840.c
> @@ -651,7 +651,9 @@ static void mos7840_interrupt_callback(struct urb *urb)
> wreg = MODEM_STATUS_REGISTER;
> break;
> }
> - rv = mos7840_get_reg(mos7840_port, wval, wreg, &Data);
> + if (mos7840_get_reg(mos7840_port, wval,
> + wreg, &Data) < 0)
> + rv = -1;
Please use a "real" error value, or even better yet, use the error value
returned from the call here.
And please identify the driver you are modifying in the Subject: line,
like I have changed this one to.
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists