c
// Define a cleanup function
static void qca_cleanup(struct hci_dev *hdev, u8 *data) {
    vfree(data);
}

// ...

51  if (ret) {
52      qca_cleanup(hdev, data); // Call the cleanup function
53      return ret;
54  }

// ...

84 out:
85  qca_cleanup(hdev, data); // Call the cleanup function
86  return ret;
