[PATCH] bluetooth: don't create the HSP/HFP profile twice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2016-08-10 at 21:00 +0530, Arun Raghavan wrote:
> On Sun, 31 Jul 2016, at 05:14 AM, Tanu Kaskinen wrote:
> > 
> > create_card_profile() used to get called separately for HSP and HFP,
> > so if a headset supports both profiles, a profile named
> > "headset_head_unit" would get created twice. The second instance would
> > get immediately freed, so that wasn't a particularly serious problem.
> > However, I think it makes more sense to create the profile only once.
> > This patch makes things so that before a profile is created, we check
> > what name that profile would have, and if a profile with that name
> > already exists, we don't create the profile.
> > 
> > A couple of Yocto releases (jethro and krogoth) have non-upstream
> > patches that suffer from this double creation. The patches add
> > associations between profiles and ports, and those associations use
> > the profile name as the key. When the second profile gets freed, the
> > associations between the profile and its ports get removed, and since
> > the profile name is used as the key, this erroneously affects the
> > first profile too. Crashing ensues.
> > 
> > I have tested this only with BlueZ 5.
> > 
> > BugLink: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10018
> > ---
> 
> BlueZ 5 side of things look fine to me. If someone's verified that BlueZ
> 4 hasn't broken, go ahead and push.

Thanks! I checked that BlueZ 4 didn't break. Pushed now.

-- 
Tanu


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux