summaryrefslogtreecommitdiff
path: root/tools/hciattach_ath3k.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2011-05-09 13:52:13 +0200
committerJohan Hedberg <jh@dell.(none)>2011-05-15 01:47:06 +0300
commit11e433f53e4f16a57fd2dd586d8a41fbfb8ff120 (patch)
tree165e0b3380b50cd5191c33cc9ecd0941ae6da286 /tools/hciattach_ath3k.c
parent18de55c8ad2daf7730e6e0c858a28d87629ee19e (diff)
downloadbluez-11e433f53e4f16a57fd2dd586d8a41fbfb8ff120.tar.gz
Fix redundant null check on calling free()
Diffstat (limited to 'tools/hciattach_ath3k.c')
-rw-r--r--tools/hciattach_ath3k.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/tools/hciattach_ath3k.c b/tools/hciattach_ath3k.c
index 728e6605f..803cf464b 100644
--- a/tools/hciattach_ath3k.c
+++ b/tools/hciattach_ath3k.c
@@ -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;
}