tm_wheel
struct tm_wheel *tm_wheel = hid_get_drvdata(hdev);
if (tm_wheel->response->type == cpu_to_le16(0x49))
model = le16_to_cpu(tm_wheel->response->data.a.model);
else if (tm_wheel->response->type == cpu_to_le16(0x47))
model = le16_to_cpu(tm_wheel->response->data.b.model);
hid_err(hdev, "Unknown packet type 0x%x, unable to proceed further with wheel init\n", tm_wheel->response->type);
tm_wheel->change_request->wValue = cpu_to_le16(twi->switch_value);
tm_wheel->urb,
tm_wheel->usb_dev,
usb_sndctrlpipe(tm_wheel->usb_dev, 0),
(char *)tm_wheel->change_request,
ret = usb_submit_urb(tm_wheel->urb, GFP_ATOMIC);
struct tm_wheel *tm_wheel = hid_get_drvdata(hdev);
usb_kill_urb(tm_wheel->urb);
kfree(tm_wheel->change_request);
kfree(tm_wheel->response);
kfree(tm_wheel->model_request);
usb_free_urb(tm_wheel->urb);
kfree(tm_wheel);
struct tm_wheel *tm_wheel = NULL;
tm_wheel = kzalloc_obj(struct tm_wheel);
if (!tm_wheel) {
tm_wheel->urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!tm_wheel->urb) {
tm_wheel->model_request = kmemdup(&model_request,
if (!tm_wheel->model_request) {
tm_wheel->response = kzalloc_obj(struct tm_wheel_response);
if (!tm_wheel->response) {
tm_wheel->change_request = kmemdup(&change_request,
if (!tm_wheel->change_request) {
tm_wheel->usb_dev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
hid_set_drvdata(hdev, tm_wheel);
tm_wheel->urb,
tm_wheel->usb_dev,
usb_rcvctrlpipe(tm_wheel->usb_dev, 0),
(char *)tm_wheel->model_request,
tm_wheel->response,
ret = usb_submit_urb(tm_wheel->urb, GFP_ATOMIC);
error6: kfree(tm_wheel->change_request);
error5: kfree(tm_wheel->response);
error4: kfree(tm_wheel->model_request);
error3: usb_free_urb(tm_wheel->urb);
error2: kfree(tm_wheel);