Message ID | 20221029170408.175533-2-abhay.maheshbhai.maheta@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | To add support for Metadata, CID, VID | expand |
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=690159 ---Test result--- Test Summary: CheckPatch PASS 5.60 seconds GitLint PASS 3.64 seconds Prep - Setup ELL PASS 26.71 seconds Build - Prep PASS 0.68 seconds Build - Configure PASS 8.32 seconds Build - Make PASS 749.65 seconds Make Check PASS 11.86 seconds Make Check w/Valgrind PASS 292.31 seconds Make Distcheck PASS 240.14 seconds Build w/ext ELL - Configure PASS 8.38 seconds Build w/ext ELL - Make PASS 85.77 seconds Incremental Build w/ patches PASS 503.62 seconds Scan Build WARNING 547.38 seconds Details ############################## Test: Scan Build - WARNING Desc: Run Scan Build with patches Output: ***************************************************************************** The bugs reported by the scan-build may or may not be caused by your patches. Please check the list and fix the bugs if they are caused by your patch. ***************************************************************************** client/player.c:1770:25: warning: Dereference of null pointer iov_append(&cfg->caps, preset->data.iov_base, preset->data.iov_len); ^~~~~~~~~~~~~~~~~~~~~ 1 warning generated. profiles/audio/media.c:1159:3: warning: Potential leak of memory pointed to by 'metadata' error("Could not allocate name for pac %s:%s", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./src/log.h:62:2: note: expanded from macro 'error' btd_error(0xffff, "%s:%s() " fmt, __FILE__, __func__, ## arg) ^~~~~~~~~ 1 warning generated. --- Regards, Linux Bluetooth
Hi Abhay, On Sat, Oct 29, 2022 at 9:53 AM Abhay Maheta <abhay.maheshbhai.maheta@intel.com> wrote: > > This adds fixes for handing for Company ID and Vendor Codec ID > while adding PAC record to database and responding to Attribute > Read Request for Sink/Source PAC Characteristics. > --- > src/shared/bap.c | 5 +++++ > src/shared/bap.h | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/src/shared/bap.c b/src/shared/bap.c > index c3c0d596f..0ae0eba33 100644 > --- a/src/shared/bap.c > +++ b/src/shared/bap.c > @@ -416,6 +416,8 @@ static void pac_foreach(void *data, void *user_data) > > p = iov_add(iov, sizeof(*p)); > p->codec.id = pac->codec.id; Lets check if the codec.id is 0xff before attempting to assign these values, btw since they are le16 we need to use cpu_to_le16 when assigning. > + p->codec.cid = pac->codec.cid; > + p->codec.vid = pac->codec.vid; > > if (pac->data) { > p->cc_len = pac->data->iov_len; > @@ -2415,6 +2417,9 @@ struct bt_bap_pac *bt_bap_add_vendor_pac(struct gatt_db *db, > if (!bdb) > return NULL; > > + if ((id != 0xff) && ((cid != 0U) || (vid != 0U))) > + return NULL; > + > codec.id = id; > codec.cid = cid; > codec.vid = vid; > diff --git a/src/shared/bap.h b/src/shared/bap.h > index 7b9f88c83..923669f32 100644 > --- a/src/shared/bap.h > +++ b/src/shared/bap.h > @@ -39,8 +39,8 @@ struct bt_bap_stream; > > struct bt_bap_codec { > uint8_t id; > - uint16_t vid; > uint16_t cid; > + uint16_t vid; > } __packed; > > struct bt_ltv { > -- > 2.25.1 >
diff --git a/src/shared/bap.c b/src/shared/bap.c index c3c0d596f..0ae0eba33 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -416,6 +416,8 @@ static void pac_foreach(void *data, void *user_data) p = iov_add(iov, sizeof(*p)); p->codec.id = pac->codec.id; + p->codec.cid = pac->codec.cid; + p->codec.vid = pac->codec.vid; if (pac->data) { p->cc_len = pac->data->iov_len; @@ -2415,6 +2417,9 @@ struct bt_bap_pac *bt_bap_add_vendor_pac(struct gatt_db *db, if (!bdb) return NULL; + if ((id != 0xff) && ((cid != 0U) || (vid != 0U))) + return NULL; + codec.id = id; codec.cid = cid; codec.vid = vid; diff --git a/src/shared/bap.h b/src/shared/bap.h index 7b9f88c83..923669f32 100644 --- a/src/shared/bap.h +++ b/src/shared/bap.h @@ -39,8 +39,8 @@ struct bt_bap_stream; struct bt_bap_codec { uint8_t id; - uint16_t vid; uint16_t cid; + uint16_t vid; } __packed; struct bt_ltv {