[RFC] Need to unref and free user data in gatt_find_info for plen 0 case

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

 



Hi,

Please provide comments on below. thx
1. In gatt_find_info if start handle > end handle , then still we
issue ATT_Find_Info_Req and receive response from remote device as
invalid handle, its ok though from spec point of view but however its
an overhead which can be reduced with below check.
2. In gatt_find_info with plen 0, it needs unref and freeing user_data
as the descriptor_cb won't be triggered in this case, and there will
be a reference count mismatch.
below change takes care of both,

-        if (plen == 0)
+       if (plen == 0 || start > end) {
+               g_attrib_unref(attrib);
+               g_free(user_data);
                 return 0;
+       }


Regards
Vishwanath
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux