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: <aByHDZyu0pptFUlK@stanley.mountain>
Date: Thu, 8 May 2025 13:27:25 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Colin Ian King <colin.i.king@...il.com>
Cc: Mikhail Ulyanov <mikhail.ulyanov@...entembedded.com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Geert Uytterhoeven <geert+renesas@...der.be>,
	Magnus Damm <magnus.damm@...il.com>, linux-media@...r.kernel.org,
	linux-renesas-soc@...r.kernel.org, kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] media: rcar_jpu: remove redundant case statement
 when c is zero

On Thu, May 08, 2025 at 11:08:35AM +0100, Colin Ian King wrote:
> The case statement where c is zero is redundant because the previous
> while loop will only exit if c is non-zero or non-0xff, so c can
> never be zero by the time the switch statement is reaced. Clean up
> the code by removing it.
> 
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
>  drivers/media/platform/renesas/rcar_jpu.c | 2 --
>  1 file changed, 2 deletions(-)
> 

   612  
   613          for (;;) {
   614                  int c;
   615  
   616                  /* skip preceding filler bytes */
   617                  do
   618                          c = get_byte(&jpeg_buffer);
   619                  while (c == 0xff || c == 0);

Unrelated to your commit, but get_byte() returns -1 for out of
bounds.  I wish there were a explicit check for that.  We end
up hitting one of the "return 0;" statements depending on if
we've found a JPEG_MARKER_SOI.

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ