Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp508447ybd; Sat, 29 Jun 2019 01:36:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwl7cn5lzRDDwXOFPB5WDzecKtQzqjA7kRc/1WqUCnHS4OMcRykARL4IXrLGqZNFJYduohJ X-Received: by 2002:a17:902:f81:: with SMTP id 1mr16303052plz.191.1561797416334; Sat, 29 Jun 2019 01:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561797416; cv=none; d=google.com; s=arc-20160816; b=N+EsBVL4In6Lz5mW2GXQ2IeaU3UyFRUQRsA2t3UeZFQqBd+GMl0dpJAFHL396aTu5v bmi/uQsJWpzizmbsgRqteKRGfuhNUaOpnNCJVi5F/ftejhxVUVR/0migKdOs8f7g5a+p CCe9DWNxKn3v1NE/dZbMr4GydWiuJxH8m7PtO+g8SHxUrfmDXP2NOA80iK2lZOcYPLrW 6xtiph3gnzFjBQZ2+mFZYRHjxLIbLNz3JaQPLR4HNN8lZSXVavKbFE7IfPzbGX0H3BpY k+V8E0ZzxbGWci/0dqTjayBhf1cmzwpfj+z+Pd9p5x+/uUPwJyiS/vYLfmtK1ELR5wYM 7PUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:date:from :dkim-signature; bh=1YvU2FIA7Ikg97CRGU4+s26fQbNERK2qByWTZJ+ydKE=; b=SKz8UgOQEjpkqXRi9uqusoVKSY6AMXTeFD784lfTBjbHHWNzX2e3IdCNHDP0SnSrwu o4ogRGhKh4SGnBmvNhvkX479mqnrY2EOfrowqr+Bi6hmH2TekM3hPaS3cvgal7RiXrWP Q9IRxM4MMP+3J2uXsgbZ5YDE+IeMb2NM3wO5vGqUvay2Ypxlv9hNqjFhIJisBuEG7T2t WkuMy5G7WsMo2UtrtJLl2Nb3cPi1MiFsFEL58CGNtqCAoqnqB5sNRTzULkvFcQsJDdd3 lGrVGnvH4xDwxGzzeFINriz2WIwBHM+iT1SPBdb7Y62NY9hjE2aTmdRc13/GPoSgYlLl hQmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=VsffgTf+; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14si4124853pgh.128.2019.06.29.01.36.18; Sat, 29 Jun 2019 01:36:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=VsffgTf+; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbfF2Iej (ORCPT + 99 others); Sat, 29 Jun 2019 04:34:39 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:39495 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726766AbfF2Iej (ORCPT ); Sat, 29 Jun 2019 04:34:39 -0400 Received: by mail-lj1-f195.google.com with SMTP id v18so8229619ljh.6 for ; Sat, 29 Jun 2019 01:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=from:date:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=1YvU2FIA7Ikg97CRGU4+s26fQbNERK2qByWTZJ+ydKE=; b=VsffgTf+RefVgV6acPXSL8V9aA/PdLM/B1XOav0U3MCPYIp+GD/skroA0rojz5buLW NdX4/3r0fN328C9fu1CmAuIB9cTqli+OFNhcrNympMAPR7p7N4NE9GUwAckhcvRMlU88 sm9GcEjwP4/xl0wVGFKau784K6Q0cMbYZrnOTcI0HZQ0hx1VTd1JkzeVxNYBe3eiAqHk n1RJT3eS9nud5x7DiOAS/rZ17f8jjVejHe9zno0pvoeHcWuH5PgVIXI9edlijdpomIGY 9F7OqhGlwH0KmdVY17Q4JZsavCWa4GJc6WwUxk0IxomKGX3U2HjiIBwga6Z7WOSohF2k NmTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=1YvU2FIA7Ikg97CRGU4+s26fQbNERK2qByWTZJ+ydKE=; b=S6xrvafECi078NYp2ZS/9PPEvWC4dTCePCzpHpYXL1zO3k4wLmZC5EklGXBvViw23k K3P8QsbbWgpMutcJNHD78R6rs38ivGE/VAQTF+7d4gQFkxoWyIDBCyO4aZ/zwP/pUh0j YXe4M6jhVcFkf22LtjR2+pg4WP9WV1VNIbiPUl8IOhm+fk5BP1+fW5iVrVLcNenXXUle QuQ3mGj5se6POmBWThGXNoWanoEF7ie8HDJO8ZjxDUsXeFTBXW11HZfPqFw/c/oKVfHD S7GBHpUgDPkO17kZ/F57TTKI/x9npjpJOMO0pukZmlskAoCYNL+nQFOdElGi9Q5qSSiW VjYQ== X-Gm-Message-State: APjAAAX47jbGiW2odLKdTltxt5QhAFYq+9DuIDkKRU1SoWX/JaH/6mLS WD+TpAFkVNXCPcD2gr7WqLEJfQ== X-Received: by 2002:a2e:81c1:: with SMTP id s1mr8327424ljg.103.1561797276845; Sat, 29 Jun 2019 01:34:36 -0700 (PDT) Received: from kynes (apn-77-112-37-101.dynamic.gprs.plus.pl. [77.112.37.101]) by smtp.gmail.com with ESMTPSA id y127sm1171713lff.34.2019.06.29.01.34.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 29 Jun 2019 01:34:36 -0700 (PDT) From: "=?utf-8?Q?Micha=C5=82?= Lowas-Rzechonek" X-Google-Original-From: =?utf-8?Q?Micha=C5=82?= Lowas-Rzechonek Date: Sat, 29 Jun 2019 10:34:34 +0200 To: Inga Stotland Cc: linux-bluetooth@vger.kernel.org, brian.gix@intel.com Subject: Re: [PATCH BlueZ 2/4 v3] mesh: Fix virtual address processing Message-ID: <20190629083434.edok7cdjwsjt4d7i@kynes> Mail-Followup-To: Inga Stotland , linux-bluetooth@vger.kernel.org, brian.gix@intel.com References: <20190628230142.16367-1-inga.stotland@intel.com> <20190628230142.16367-3-inga.stotland@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190628230142.16367-3-inga.stotland@intel.com> User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Inga, On 06/28, Inga Stotland wrote: > +static struct mesh_virtual *add_virtual(const uint8_t *v) > +{ > + struct mesh_virtual *virt = l_queue_find(mesh_virtuals, > + find_virt_by_label, v); > + > + if (virt) { > + virt->ref_cnt++; > + return virt; > + } > + > + virt = l_new(struct mesh_virtual, 1); > + > + if (!mesh_crypto_virtual_addr(v, &virt->addr)) { > + l_free(virt); > + return NULL; > + } > + > + memcpy(virt->label, v, 16); > + virt->ref_cnt++; I am aware that l_new zeroes the allocated object, but I think it would be clearer to say "virt->ref_cnt = 1" here. Sorry I didn't catch that earlier. Otherwise, the patchset LGTM. reagrds -- Michał Lowas-Rzechonek Silvair http://silvair.com Jasnogórska 44, 31-358 Krakow, POLAND