From: luiz.dentz@gmail.com
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 3/3] Fix uninitialized variables warnings
Date: Tue, 29 Mar 2011 14:36:55 +0300 [thread overview]
Message-ID: <1301398615-16283-3-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1301398615-16283-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
src/attrib-server.c: In function ‘channel_handler’:
src/attrib-server.c:297:21: error: ‘cur’ may be used uninitialized in this function
src/attrib-server.c:502:10: error: ‘format’ may be used uninitialized in this function
src/attrib-server.c:503:11: error: ‘length’ may be used uninitialized in this function
make[1]: *** [src/attrib-server.o] Error 1
---
src/attrib-server.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/attrib-server.c b/src/attrib-server.c
index dc05d7e..fb89ea5 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -294,7 +294,7 @@ static uint16_t read_by_group(struct gatt_channel *channel, uint16_t start,
{
struct att_data_list *adl;
struct attribute *a;
- struct group_elem *cur, *old = NULL;
+ struct group_elem *cur = NULL, *old = NULL;
GSList *l, *groups;
uint16_t length, last_handle, last_size = 0;
uint8_t status;
@@ -499,8 +499,8 @@ static int find_info(uint16_t start, uint16_t end, uint8_t *pdu, int len)
struct attribute *a;
struct att_data_list *adl;
GSList *l, *info;
- uint8_t format, last_type = BT_UUID_UNSPEC;
- uint16_t length, num;
+ uint8_t format = 0, last_type = BT_UUID_UNSPEC;
+ uint16_t length = 0, num;
int i;
if (start > end || start == 0x0000)
--
1.7.4.1
next prev parent reply other threads:[~2011-03-29 11:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-29 11:36 [PATCH 1/3] Fix uninitialized variable warning luiz.dentz
2011-03-29 11:36 ` [PATCH 2/3] " luiz.dentz
2011-03-29 11:36 ` luiz.dentz [this message]
2011-03-29 13:10 ` [PATCH 3/3] Fix uninitialized variables warnings Anderson Lizardo
2011-03-29 13:18 ` Luiz Augusto von Dentz
2011-03-29 13:20 ` Anderson Lizardo
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=1301398615-16283-3-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@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