Linux bluetooth development
 help / color / mirror / Atom feed
From: Steve Brown <sbrown@cortland.com>
To: linux-bluetooth@vger.kernel.org
Cc: Steve Brown <sbrown@cortland.com>
Subject: [PATCH 2/2] mesh: node: Correct minor errors
Date: Fri, 16 Feb 2018 07:20:01 -0500	[thread overview]
Message-ID: <20180216122001.6923-2-sbrown@cortland.com> (raw)
In-Reply-To: <20180216122001.6923-1-sbrown@cortland.com>

Correct length computation in node_parse_composition()
Correct return value in node_set_model()
  An existing node is not an error
---
 mesh/node.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mesh/node.c b/mesh/node.c
index fc8898c49..9ff741962 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -417,7 +417,7 @@ bool node_parse_composition(struct mesh_node *node, uint8_t *data, uint16_t len)
 
 		m = *data++;
 		v = *data++;
-		len -= 4;
+		len -= 2;
 
 		while (len >= 2 && m--) {
 			mod_id = get_le16(data);
@@ -691,7 +691,7 @@ bool node_set_model(struct mesh_node *node, uint8_t ele_idx, uint32_t id)
 	l = g_list_find_custom(ele->models, GUINT_TO_POINTER(id),
 				match_model_id);
 	if (l)
-		return false;
+		return true;
 
 	model = g_malloc0(sizeof(struct mesh_model));
 	if (!model)
-- 
2.14.1


  reply	other threads:[~2018-02-16 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16 12:20 [PATCH 1/2] mesh: prov-db: Correct json database parsing Steve Brown
2018-02-16 12:20 ` Steve Brown [this message]
2018-02-25 18:34 ` Johan Hedberg

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=20180216122001.6923-2-sbrown@cortland.com \
    --to=sbrown@cortland.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