lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALF0-+WZAEye35J8b6iWn+Vuc6fGDdWL9seJVohBnnN0SJmceA@mail.gmail.com>
Date:	Wed, 17 Oct 2012 09:39:38 -0300
From:	Ezequiel Garcia <elezegarcia@...il.com>
To:	Jesper Juhl <jj@...osbits.net>
Cc:	Mauro Carvalho Chehab <mchehab@...radead.org>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [media] stk1160: Check return value of stk1160_read_reg()
 in stk1160_i2c_read_reg()

On Tue, Oct 16, 2012 at 4:06 PM, Jesper Juhl <jj@...osbits.net> wrote:
> On Mon, 15 Oct 2012, Ezequiel Garcia wrote:
>
>> On Mon, Oct 15, 2012 at 9:03 PM, Jesper Juhl <jj@...osbits.net> wrote:
>> > On Mon, 15 Oct 2012, Ezequiel Garcia wrote:
>> >
>> >> On Mon, Oct 15, 2012 at 7:52 PM, Jesper Juhl <jj@...osbits.net> wrote:
>> >> > On Mon, 15 Oct 2012, Jesper Juhl wrote:
>> >> >
>> >> >> On Sat, 13 Oct 2012, Ezequiel Garcia wrote:
>> >> >>
>> > [...]
>> >> > Currently there are two checks for 'rc' being less than zero with no
>> >> > change to 'rc' between the two, so the second is just dead code.
>> >> > The intention seems to have been to assign the return value of
>> >> > 'stk1160_read_reg()' to 'rc' before the (currently dead) second check
>> >> > and then test /that/. This patch does that.
>> >> >
>> >>
>> >> This is an overly complicated explanation for such a small patch.
>> >> Can you try to simplify it?
>> >>
>> > How's this?
>> >
>> >
>> > From: Jesper Juhl <jj@...osbits.net>
>> > Date: Sat, 13 Oct 2012 00:16:37 +0200
>> > Subject: [PATCH] [media] stk1160: Check return value of stk1160_read_reg() in stk1160_i2c_read_reg()
>> >
>> > Remember to collect the exit status from 'stk1160_read_reg()' in 'rc'
>> > before testing it for less than zero.
>> >
>> > Signed-off-by: Jesper Juhl <jj@...osbits.net>
>> > ---
>> >  drivers/media/usb/stk1160/stk1160-i2c.c |    3 +--
>> >  1 files changed, 1 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/media/usb/stk1160/stk1160-i2c.c b/drivers/media/usb/stk1160/stk1160-i2c.c
>> > index 176ac93..a2370e4 100644
>> > --- a/drivers/media/usb/stk1160/stk1160-i2c.c
>> > +++ b/drivers/media/usb/stk1160/stk1160-i2c.c
>> > @@ -116,10 +116,9 @@ static int stk1160_i2c_read_reg(struct stk1160 *dev, u8 addr,
>> >         if (rc < 0)
>> >                 return rc;
>> >
>> > -       stk1160_read_reg(dev, STK1160_SBUSR_RD, value);
>> > +       rc = stk1160_read_reg(dev, STK1160_SBUSR_RD, value);
>> >         if (rc < 0)
>> >                 return rc;
>> > -
>> ^^^^^^^^^^^^^^^^^^^^^^^^
>> Sorry for the nitpick, but I'd like you to *not* remove this line.
>>
> No problem.
> I hope the below is OK :-)
>
>
> From: Jesper Juhl <jj@...osbits.net>
> Date: Sat, 13 Oct 2012 00:16:37 +0200
> Subject: [PATCH] [media] stk1160: Check return value of stk1160_read_reg() in stk1160_i2c_read_reg()
>
> Remember to collect the exit status from 'stk1160_read_reg()' in 'rc'
> before testing it for less than zero.
>
> Signed-off-by: Jesper Juhl <jj@...osbits.net>
> ---
>  drivers/media/usb/stk1160/stk1160-i2c.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/usb/stk1160/stk1160-i2c.c b/drivers/media/usb/stk1160/stk1160-i2c.c
> index 176ac93..850cf28 100644
> --- a/drivers/media/usb/stk1160/stk1160-i2c.c
> +++ b/drivers/media/usb/stk1160/stk1160-i2c.c
> @@ -116,7 +116,7 @@ static int stk1160_i2c_read_reg(struct stk1160 *dev, u8 addr,
>         if (rc < 0)
>                 return rc;
>
> -       stk1160_read_reg(dev, STK1160_SBUSR_RD, value);
> +       rc = stk1160_read_reg(dev, STK1160_SBUSR_RD, value);
>         if (rc < 0)
>                 return rc;
>
> --
> 1.7.1
>
>
> --
> Jesper Juhl <jj@...osbits.net>       http://www.chaosbits.net/
> Don't top-post http://www.catb.org/jargon/html/T/top-post.html
> Plain text mails only, please.
>

Acked-by: Ezequiel Garcia <elezegarcia@...il.com>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ