All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gix, Brian" <brian.gix@intel.com>
To: "linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"Stotland, Inga" <inga.stotland@intel.com>
Cc: "michal.lowas-rzechonek@silvair.com" 
	<michal.lowas-rzechonek@silvair.com>
Subject: Re: [PATCH BlueZ 1/1] mesh: Fix checks when restoring internal model state
Date: Thu, 4 Jul 2019 00:16:24 +0000	[thread overview]
Message-ID: <1562199382.23933.39.camel@intel.com> (raw)
In-Reply-To: <20190703205341.11065-1-inga.stotland@intel.com>

Applied

On Wed, 2019-07-03 at 13:53 -0700, Inga Stotland wrote:
> This fixes incorrect conditional checks in restore_model_state()
> which could lead to dereferencing a NULL pointer.
> 
> Wrong: if (l_queue_isempty(mod->bindings) || !mod->cbs->bind) ...
> Fixed: if (!l_queue_isempty(mod->bindings) && cbs->bind) ...
> ---
>  mesh/model.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mesh/model.c b/mesh/model.c
> index a2b3e5c18..e4a7ba94e 100644
> --- a/mesh/model.c
> +++ b/mesh/model.c
> @@ -1077,7 +1077,7 @@ static void restore_model_state(struct mesh_model *mod)
>  	if (!cbs)
>  		return;
>  
> -	if (l_queue_isempty(mod->bindings) || !mod->cbs->bind) {
> +	if (!l_queue_isempty(mod->bindings) && cbs->bind) {
>  		for (b = l_queue_get_entries(mod->bindings); b; b = b->next) {
>  			if (cbs->bind(L_PTR_TO_UINT(b->data), ACTION_ADD) !=
>  							MESH_STATUS_SUCCESS)

      reply	other threads:[~2019-07-04  0:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 20:53 [PATCH BlueZ 1/1] mesh: Fix checks when restoring internal model state Inga Stotland
2019-07-04  0:16 ` Gix, Brian [this message]

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=1562199382.23933.39.camel@intel.com \
    --to=brian.gix@intel.com \
    --cc=inga.stotland@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=michal.lowas-rzechonek@silvair.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.