From: Johan Hedberg Date: Wed, 22 Feb 2012 19:39:58 +0000 (+0200) Subject: Bluetooth: mgmt: Fix name_changed event for short name changes X-Git-Tag: v3.4-rc1~177^2~112^2~65 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7bdaae4a4bc075cf73ab9c3a531b7229caa1f49e;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git Bluetooth: mgmt: Fix name_changed event for short name changes Since we can't reliably track the short name changes just assume that we had a change whenever there's a pending mgmt command. In the worst case we just get one unnecessary name_changed signal. Signed-off-by: Johan Hedberg Acked-by: Marcel Holtmann --- diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 9c1f771..ee57edb 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -3586,6 +3586,10 @@ int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status) if (!cmd) goto send_event; + /* Always assume that either the short or the complete name has + * changed if there was a pending mgmt command */ + changed = true; + if (status) { err = cmd_status(cmd->sk, hdev->id, MGMT_OP_SET_LOCAL_NAME, mgmt_status(status));