Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp774787ybi; Sat, 29 Jun 2019 23:42:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYhWZtYxPfZjZP4Asd5+OYS+RozhRYmZ1dCiDTdgnZxBPQ9257LpUgkZtdRhu9xXUlL0km X-Received: by 2002:a17:90a:dc86:: with SMTP id j6mr22270598pjv.141.1561876979817; Sat, 29 Jun 2019 23:42:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561876979; cv=none; d=google.com; s=arc-20160816; b=m7XkQ8iunPjSgU6CgISeyOd6ag2uY5WkNjqAEQgSBFf3PWo61g9XLVfLX0keHpUIG7 x5W8gHpIdcUlZkyaOaWpZ7MN9fsPfUrSOugwrRkmbO16cCkHLgUqwvQyePGwdo/jIUR4 bUgechveD3Q0ca89PYLJUz23ww8KdRgGEf0wIVACgs6y/hcAVCZJRHK3TBSu8BOCkOBa m3gZBVVs+jxc+QWAKn78uPFrVEQ8E+3tJBXI51BtzA973r6nKUm7I2ej6d8wrmA31DIz 5FpFagqY+dSxHXnfF6j6Ll8h9fRy540P4X/DCLznKPB6bWOpCQrPvc+wQYi1exEGqMP4 f1sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=cru+U/e6LaCpuY2a/l28sGk83uc9N00JAnhWZQuvJUE=; b=QlIIBZh3+RP8FnYw7YeswglDDnkvkuDmh0UOANHu4vGaDZZkBc8LpHIQTl1LdpYGBo lFx4bC3TytlGumrtRG/o8zD7SNydZNpz5+FctwkDAFnWkyzmJg41yNh/y0+4dPFen8gt hfpFHEMs873NLuY0nQe9AGb87Ipp/RCk5vxV0UQpsKxWG4qUug5QHty4r3OSd0l2FB/U AXEtmwE2CmU5jnzEMnoFZC2/FZMgcKlaB3q6YcweYMWjsKyIZRp2fs7NseQiDjqN+HAC LJixr4QreynuElFbWb5pwIQ6gYv6uWX6loUPy/jRI66aRdfoWepThNzn13MzFB3JD5iR pm6A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si7751661pfe.183.2019.06.29.23.42.22; Sat, 29 Jun 2019 23:42:59 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725976AbfF3GmT (ORCPT + 99 others); Sun, 30 Jun 2019 02:42:19 -0400 Received: from mga05.intel.com ([192.55.52.43]:20279 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbfF3GmT (ORCPT ); Sun, 30 Jun 2019 02:42:19 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2019 23:42:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,434,1557212400"; d="p7s'?scan'208";a="163361743" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by fmsmga008.fm.intel.com with ESMTP; 29 Jun 2019 23:42:18 -0700 Received: from orsmsx116.amr.corp.intel.com (10.22.240.14) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 29 Jun 2019 23:42:17 -0700 Received: from orsmsx103.amr.corp.intel.com ([169.254.5.135]) by ORSMSX116.amr.corp.intel.com ([169.254.7.109]) with mapi id 14.03.0439.000; Sat, 29 Jun 2019 23:42:17 -0700 From: "Stotland, Inga" To: "michal.lowas-rzechonek@silvair.com" CC: "linux-bluetooth@vger.kernel.org" , "Gix, Brian" Subject: Re: [PATCH BlueZ 2/4 v3] mesh: Fix virtual address processing Thread-Topic: [PATCH BlueZ 2/4 v3] mesh: Fix virtual address processing Thread-Index: AQHVLgV51nJFkBTtCkGKh0HPph4mqKayxEIAgAFy8YA= Date: Sun, 30 Jun 2019 06:42:16 +0000 Message-ID: <3e78e37fa2fec9b047fc92154f66297886ef3642.camel@intel.com> References: <20190628230142.16367-1-inga.stotland@intel.com> <20190628230142.16367-3-inga.stotland@intel.com> <20190629083434.edok7cdjwsjt4d7i@kynes> In-Reply-To: <20190629083434.edok7cdjwsjt4d7i@kynes> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.254.103.65] Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-DPyrdSrs2Soch2fxIkwQ" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --=-DPyrdSrs2Soch2fxIkwQ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Michal, On Sat, 2019-06-29 at 10:34 +0200, Micha=C5=82 Lowas-Rzechonek wrote: > Hi Inga, >=20 > On 06/28, Inga Stotland wrote: > > +static struct mesh_virtual *add_virtual(const uint8_t *v) > > +{ > > + struct mesh_virtual *virt =3D l_queue_find(mesh_virtuals, > > + find_virt_by_label, v); > > + > > + if (virt) { > > + virt->ref_cnt++; > > + return virt; > > + } > > + > > + virt =3D 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++; >=20 > I am aware that l_new zeroes the allocated object, but I think it > would > be clearer to say "virt->ref_cnt =3D 1" here. >=20 I agree, this is better. Thanks for the review. Inga --=-DPyrdSrs2Soch2fxIkwQ Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKbDCCBOsw ggPToAMCAQICEDabxALowUBS+21KC0JI8fcwDQYJKoZIhvcNAQEFBQAwbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0 d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9vdDAeFw0xMzEyMTEwMDAwMDBa Fw0yMDA1MzAxMDQ4MzhaMHkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEUMBIGA1UEBxMLU2Fu dGEgQ2xhcmExGjAYBgNVBAoTEUludGVsIENvcnBvcmF0aW9uMSswKQYDVQQDEyJJbnRlbCBFeHRl cm5hbCBCYXNpYyBJc3N1aW5nIENBIDRCMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA yzuW/y/g0bznz8BD48M94luFzqHaqY9yGN9H/W0J7hOVBpl0rTQJ6kZ7z7hyDb9kf2UW4ZU25alC i+q5m6NwHg+z9pcN7bQ84SSBueaYF7cXlAg7z3XyZbzSEYP7raeuWRf5fYvYzq8/uI7VNR8o/43w PtDP10YDdO/0J5xrHxnC/9/aU+wTFSVsPqxsd7C58mnu7G4VRJ0n9PG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