linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Fix eir parsing function.
@ 2013-11-29  8:00 Andrei Emeltchenko
  2013-11-29  8:22 ` Johan Hedberg
  0 siblings, 1 reply; 8+ messages in thread
From: Andrei Emeltchenko @ 2013-11-29  8:00 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Currently eir_parse always return 0 but it is checked throughout the
code (in android/bluetooth code as well in src/adapteri, etc) for
return value (err < 0) which never happens. Return -1 if there is
nothing to parse. Send as RFC as I do not know how current code supposed
to be working.
---
 src/eir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/eir.c b/src/eir.c
index 084884e..f7450c9 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -138,7 +138,7 @@ int eir_parse(struct eir_data *eir, const uint8_t *eir_data, uint8_t eir_len)
 
 	/* No EIR data to parse */
 	if (eir_data == NULL)
-		return 0;
+		return -1;
 
 	while (len < eir_len - 1) {
 		uint8_t field_len = eir_data[0];
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-12-10  8:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-29  8:00 [RFC] Fix eir parsing function Andrei Emeltchenko
2013-11-29  8:22 ` Johan Hedberg
2013-11-29  8:39   ` Szymon Janc
2013-11-29  8:54     ` Johan Hedberg
2013-11-29  9:03       ` Szymon Janc
2013-12-10  8:15   ` [PATCHv2] " Andrei Emeltchenko
2013-12-10  8:24     ` Bastien Nocera
2013-12-10  8:33     ` Johan Hedberg

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).