return;
}
- fseek(fp, 0L, SEEK_SET);
- rv = fscanf(fp, "%17s", bssid);
+ rv = fseek(fp, 0L, SEEK_SET);
+ if (rv != 0) {
+ ERR("Fail to seek file");
+ fclose(fp);
+ return;
+ }
- if (rv < 0)
+ rv = fscanf(fp, "%17s", bssid);
+ if (rv < 0) {
ERR("Fail to read bssid");
+ fclose(fp);
+ return;
+ }
netconfig_set_vconf_str(VCONF_WIFI_BSSID_ADDRESS, bssid);