Skip to content

Commit be71dfb

Browse files
ChrisCH-LuVudentz
authored andcommitted
Bluetooth: btusb: mediatek: remove the unnecessary goto tag
Remove the unnecessary goto tag whether there is an error or not, we have to free the buffer at the end of the function. Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Chris Lu <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 936daee commit be71dfb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/bluetooth/btusb.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,12 +2957,9 @@ static int btusb_mtk_uhw_reg_write(struct btusb_data *data, u32 reg, u32 val)
29572957
0x5E,
29582958
reg >> 16, reg & 0xffff,
29592959
buf, 4, USB_CTRL_SET_TIMEOUT);
2960-
if (err < 0) {
2960+
if (err < 0)
29612961
bt_dev_err(hdev, "Failed to write uhw reg(%d)", err);
2962-
goto err_free_buf;
2963-
}
29642962

2965-
err_free_buf:
29662963
kfree(buf);
29672964

29682965
return err;

0 commit comments

Comments
 (0)