From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
s.nawrocki@samsung.com
Subject: Re: [PATCH] s5p-jpeg: fix uninitialized use in hdr parse
Date: Sat, 12 Oct 2013 11:39:13 +0200 [thread overview]
Message-ID: <525918C1.7090704@gmail.com> (raw)
In-Reply-To: <1381388791-1828-1-git-send-email-sw0312.kim@samsung.com>
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@samsung.com>
> ---
> 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
next prev parent reply other threads:[~2013-10-12 9:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-10 7:06 [PATCH] s5p-jpeg: fix uninitialized use in hdr parse Seung-Woo Kim
2013-10-12 9:39 ` Sylwester Nawrocki [this message]
2013-10-14 4:27 ` Seung-Woo Kim
2013-10-14 4:43 ` [PATCH v2] " Seung-Woo Kim
2013-10-15 7:44 ` Sylwester Nawrocki
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=525918C1.7090704@gmail.com \
--to=sylvester.nawrocki@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=s.nawrocki@samsung.com \
--cc=sw0312.kim@samsung.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