Bluetooth: btusb: mediatek: remove the unnecessary goto tag
authorChris Lu <chris.lu@mediatek.com>
Thu, 4 Jul 2024 06:01:09 +0000 (14:01 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 15 Jul 2024 14:11:37 +0000 (10:11 -0400)
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 <sean.wang@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btusb.c

index 2d5c971a59ada4495aead554fe1060577d9cfae2..4448c5f220f0903d9141119d286c4c81883b9820 100644 (file)
@@ -2957,12 +2957,9 @@ static int btusb_mtk_uhw_reg_write(struct btusb_data *data, u32 reg, u32 val)
                              0x5E,
                              reg >> 16, reg & 0xffff,
                              buf, 4, USB_CTRL_SET_TIMEOUT);
-       if (err < 0) {
+       if (err < 0)
                bt_dev_err(hdev, "Failed to write uhw reg(%d)", err);
-               goto err_free_buf;
-       }
 
-err_free_buf:
        kfree(buf);
 
        return err;