Fix Coverty issue 93/298893/1 accepted/tizen/8.0/unified/20231005.092628 accepted/tizen/unified/20230918.063833 tizen_8.0_m2_release
authorAyush Garg <ayush.garg@samsung.com>
Fri, 15 Sep 2023 01:21:44 +0000 (06:51 +0530)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 15 Sep 2023 01:21:44 +0000 (06:51 +0530)
This patch fixes the PHY validation logic

Change-Id: I685c7ba5fd070826c8198c9e2cc6ae585615a7af
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/bluetooth-gatt.c

index ce0acd1..d207708 100644 (file)
@@ -3652,14 +3652,14 @@ static bool __bt_gatt_is_phy_options_valid(int phy_options)
 
 static bool __bt_gatt_is_phy_valid(int phy)
 {
-       if (phy | BT_LE_2M_PHY_MASK) {
+       if (phy & BT_LE_2M_PHY_MASK) {
                bool is_2m_phy_supported = false;
                int ret = bt_adapter_le_is_2m_phy_supported(&is_2m_phy_supported);
                if (!ret || !is_2m_phy_supported)
                        return false;
        }
 
-       if (phy | BT_LE_CODED_PHY_MASK) {
+       if (phy & BT_LE_CODED_PHY_MASK) {
                bool is_coded_phy_supported = false;
                int ret = bt_adapter_le_is_coded_phy_supported(&is_coded_phy_supported);
                if (!ret || !is_coded_phy_supported)