From: Jesse Millan <jesse.millan@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] Fix gcc4 warning, def & len may be used uninitialized
Date: Wed, 25 May 2005 19:18:10 +0000 [thread overview]
Message-ID: <4294CF72.3020703@gmail.com> (raw)
In-Reply-To: <4294CCEE.70907@comcast.net>
Your right, it could go either way. Arnd Bergmann had posted earlier and
said that it would be better to make the change in the function itself.
I took that advice.
Mark Hollomon wrote:
> Jesse Millan wrote:
>
>>
>> --- linux-2.6.12-rc4/fs/cifs/asn1.c~ 2005-05-24 22:25:21.436866468
>> -0700
>> +++ linux-2.6.12-rc4/fs/cifs/asn1.c 2005-05-24 22:49:43.744939729
>> -0700
>> @@ -160,12 +160,18 @@ asn1_length_decode(struct asn1_ctx *ctx,
>> {
>> unsigned char ch, cnt;
>>
>> - if (!asn1_octet_decode(ctx, &ch))
>> + if (!asn1_octet_decode(ctx, &ch)) {
>> + /* Function would have returned without initializing 'def'
>> and 'len' */
>> + *def = 0;
>> + *len = 0;
>> return 0;
>> + }
>>
>> - if (ch = 0x80)
>> + if (ch = 0x80) {
>> *def = 0;
>> - else {
>> + /* Function would have returned without initializing 'len' */
>> + *len = 0;
>> + } else {
>> *def = 1;
>>
>> if (ch < 0x80)
>>
>>
>
> Wouldn't it be better to just initialize def and len at the top of the
> function and be done? Or does that violate some kernel style preference?
>
--
Jesse Millan
CNS Unix Team
Portland State University
Phone: (503) 725-9151
Mobile: (503) 453-0748
GPG key: www.system-calls.com/gpg.php
grep --recursive --ignore-case 'SHOULD WORK' /usr/src/linux/* | wc
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2005-05-25 19:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-25 19:07 [KJ] [PATCH] Fix gcc4 warning, def & len may be used uninitialized Mark Hollomon
2005-05-25 19:18 ` Jesse Millan [this message]
2005-05-26 23:02 ` Jesse Millan
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=4294CF72.3020703@gmail.com \
--to=jesse.millan@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).