mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-25 13:14:14 +08:00
Fix redundant null check on calling free()
This commit is contained in:
parent
18de55c8ad
commit
11e433f53e
@ -341,8 +341,7 @@ create:
|
||||
err = ioctl(ctl, HIDPCONNADD, &req);
|
||||
|
||||
error:
|
||||
if (req.rd_data)
|
||||
free(req.rd_data);
|
||||
free(req.rd_data);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -1226,8 +1226,7 @@ int main(int argc, char *argv[])
|
||||
if (transport_open(transport, device, bcsp_rate) < 0)
|
||||
exit(1);
|
||||
|
||||
if (device)
|
||||
free(device);
|
||||
free(device);
|
||||
|
||||
for (i = 0; commands[i].str; i++) {
|
||||
if (strcasecmp(commands[i].str, argv[0]))
|
||||
|
@ -148,8 +148,8 @@ static int write_cmd(int fd, uint8_t *buffer, int len)
|
||||
return err;
|
||||
|
||||
err = read_ps_event(event, HCI_PS_CMD_OCF);
|
||||
if (event)
|
||||
free(event);
|
||||
|
||||
free(event);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -493,8 +493,7 @@ static int set_patch_ram(int dev, char *patch_loc, int len)
|
||||
|
||||
err = read_ps_event(event, HCI_PS_CMD_OCF);
|
||||
|
||||
if (event)
|
||||
free(event);
|
||||
free(event);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -623,8 +622,7 @@ static int get_ath3k_crc(int dev)
|
||||
if (read_ps_event(event, HCI_PS_CMD_OCF) >= 0)
|
||||
err = -EILSEQ;
|
||||
|
||||
if (!event)
|
||||
free(event);
|
||||
free(event);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -667,8 +665,7 @@ static int get_device_type(int dev, uint32_t *code)
|
||||
*code = reg;
|
||||
|
||||
cleanup:
|
||||
if (event)
|
||||
free(event);
|
||||
free(event);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -709,8 +706,7 @@ static int read_ath3k_version(int pConfig, uint32_t *rom_version,
|
||||
*build_version = status;
|
||||
|
||||
cleanup:
|
||||
if (event)
|
||||
free(event);
|
||||
free(event);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -768,8 +764,7 @@ static int write_bdaddr(int pConfig, char *bdaddr)
|
||||
|
||||
err = read_ps_event(event, HCI_PS_CMD_OCF);
|
||||
|
||||
if (event)
|
||||
free(event);
|
||||
free(event);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user