scsc: avoid panic when getting bt/wifi mac
authorsunyue5 <sunyue5@motorola.com>
Thu, 27 Sep 2018 09:43:08 +0000 (17:43 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:30:17 +0000 (17:30 +0800)
Fix a slip of sscanf usage

Change-Id: I3b3975719267007d17bfb76fd21b828b76490ce9
Signed-off-by: sunyue5 <sunyue5@motorola.com>
Reviewed-on: https://gerrit.mot.com/1247584
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/misc/samsung/scsc_bt/scsc_bt_module.c
drivers/net/wireless/scsc/mgt.c

index 9c07f7c72fd485d63dabaf1f2693cb829081fc9f..e4cb45b64cdc92c32b3518bac0d494a831c1889e 100755 (executable)
@@ -755,10 +755,10 @@ static int setup_bhcs(struct scsc_service *service,
                                char macStr[MACSTRLEN+1] = {0};
                                u32 u[SCSC_BT_ADDR_LEN] = {0};
                                // extract MAC from boot params
-                               mac_idx += strlen(WIFI_MAC_BOOTARG);
+                               mac_idx += strlen(BT_MAC_BOOTARG);
                                memcpy(macStr, mac_idx, MACSTRLEN);
                                sscanf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X",
-                                       u[0], u[1], u[2], u[3], u[4], u[5]);
+                                       &u[0], &u[1], &u[2], &u[3], &u[4], &u[5]);
                                bhcs->bluetooth_address_lap =
                                        (u[3] << 16) | (u[4] << 8) | u[5];
                                bhcs->bluetooth_address_uap = u[2];
index 81bf1f9e31c567bd8505c85c5215ef46393b86bf..1f3fa05ec4f45669d55f3883083d92a9f21e11b0 100755 (executable)
@@ -237,7 +237,7 @@ void slsi_get_hw_mac_address(struct slsi_dev *sdev, u8 *addr)
                                mac_idx += strlen(WIFI_MAC_BOOTARG);
                                memcpy(macStr, mac_idx, MACSTRLEN);
                                sscanf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X",
-                                       u[0], u[1], u[2], u[3], u[4], u[5]);
+                                       &u[0], &u[1], &u[2], &u[3], &u[4], &u[5]);
                                for (i = 0; i < ETH_ALEN; i++)
                                        addr[i] = u[i] & 0xff;
                                SLSI_INFO(sdev, "WiFi MAC address loaded from utag: %02X:%02X:%02X:%02X:%02X:%02X\n",