2
0
forked from Ivasoft/DSView

Code refactoring 6

This commit is contained in:
dreamsourcelabTAI
2022-08-01 10:40:29 +08:00
parent 092abdcc63
commit 2433d33b5b
9 changed files with 197 additions and 79 deletions

View File

@@ -308,7 +308,7 @@ static GSList *scan(GSList *options)
}
else {
char *firmware;
char *res_path = sr_get_firmware_res_path();
char *res_path = DS_RES_PATH;
if (!(firmware = g_try_malloc(strlen(res_path)+strlen(prof->firmware)+1))) {
sr_err("Firmware path malloc error!");
return NULL;

View File

@@ -1919,7 +1919,7 @@ SR_PRIV int dsl_dev_open(struct sr_dev_driver *di, struct sr_dev_inst *sdi, gboo
if (sdi->status == SR_ST_ACTIVE) {
if (!(*fpga_done)) {
char *fpga_bit;
char *res_path = sr_get_firmware_res_path();
char *res_path = DS_RES_PATH;
if (!(fpga_bit = g_try_malloc(strlen(res_path)+strlen(devc->profile->fpga_bit33)+1))) {
sr_err("fpag_bit path malloc error!");
return SR_ERR_MALLOC;

View File

@@ -379,7 +379,7 @@ static GSList *scan(GSList *options)
}
else {
char *firmware;
char *res_path = sr_get_firmware_res_path();
char *res_path = DS_RES_PATH;
if (!(firmware = g_try_malloc(strlen(res_path)+strlen(prof->firmware)+1))) {
sr_err("Firmware path malloc error!");
return NULL;
@@ -1008,7 +1008,7 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
ret = SR_ERR;
}
char *fpga_bit;
char *res_path = sr_get_firmware_res_path();
char *res_path = DS_RES_PATH;
if (!(fpga_bit = g_try_malloc(strlen(res_path)+strlen(devc->profile->fpga_bit33)+1))) {
sr_err("fpag_bit path malloc error!");
return SR_ERR_MALLOC;