Re: [PATCH] s5p-jpeg: fix uninitialized use in hdr parse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Seung-Woo,

On 10/10/2013 09:06 AM, Seung-Woo Kim wrote:
For hdr parse error, it can return false without any assignments
which cause build warning.

Signed-off-by: Seung-Woo Kim<sw0312.kim@xxxxxxxxxxx>
---
  drivers/media/platform/s5p-jpeg/jpeg-core.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 15d2396..7db374e 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -442,14 +442,14 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result,
  	while (notfound) {
  		c = get_byte(&jpeg_buffer);
  		if (c == -1)
-			break;
+			return false;

notfound is being assigned before entering the while loop, so I'm not sure
what exactly is not correct here. Can you quote the original build warning ?
It's a good idea to always include compiler errors/warnings in the commit
message.

BTW, name of the variable is a bit confusing, I think naming it 'found' and
using negation of it would be easier to follow; that's not something we'd
be changing now though.

  		if (c != 0xff)
  			continue;
  		do
  			c = get_byte(&jpeg_buffer);
  		while (c == 0xff);
  		if (c == -1)
-			break;
+			return false;
  		if (c == 0)
  			continue;
  		length = 0;

Thanks,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux