Changeset f2964e45 in mainline
- Timestamp:
- 2011-10-14T15:36:12Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 98604cc
- Parents:
- c5b6db53
- Location:
- uspace/drv/bus/usb/usbhid/mouse
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhid/mouse/mousedev.c
rc5b6db53 rf2964e45 186 186 if (mouse_dev->wheel_sess != NULL) 187 187 async_hangup(mouse_dev->wheel_sess); 188 int ret = ddf_fun_unbind(mouse_dev->mouse_fun); 189 if (ret != EOK) { 190 usb_log_error("Failed to unbind mouse function.\n"); 191 } else { 192 ddf_fun_destroy(mouse_dev->mouse_fun); 193 /* Prevent double free */ 194 mouse_dev->wheel_fun->driver_data = NULL; 195 } 196 197 ret = ddf_fun_unbind(mouse_dev->wheel_fun); 198 if (ret != EOK) { 199 usb_log_error("Failed to unbind wheel function.\n"); 200 } else { 201 ddf_fun_destroy(mouse_dev->wheel_fun); 202 } 188 203 } 189 204 … … 338 353 usb_log_error("Could not bind DDF function: %s.\n", 339 354 str_error(rc)); 340 ddf_fun_destroy(fun);341 355 return rc; 342 356 } … … 349 363 "Could not add DDF function to category %s: %s.\n", 350 364 HID_MOUSE_CATEGORY, str_error(rc)); 351 ddf_fun_destroy(fun);352 return rc;353 }365 return rc; 366 } 367 mouse->mouse_fun = fun; 354 368 355 369 /* … … 376 390 usb_log_error("Could not bind DDF function: %s.\n", 377 391 str_error(rc)); 378 ddf_fun_destroy(fun);379 392 return rc; 380 393 } … … 387 400 "Could not add DDF function to category %s: %s.\n", 388 401 HID_MOUSE_WHEEL_CATEGORY, str_error(rc)); 389 ddf_fun_destroy(fun);390 return rc;391 }402 return rc; 403 } 404 mouse->wheel_fun = fun; 392 405 393 406 return EOK; … … 511 524 { 512 525 if (data != NULL) { 513 usb_mouse_destroy( (usb_mouse_t *)data);526 usb_mouse_destroy(data); 514 527 } 515 528 } -
uspace/drv/bus/usb/usbhid/mouse/mousedev.h
rc5b6db53 rf2964e45 55 55 56 56 ddf_dev_ops_t ops; 57 /* DDF mouse function */ 58 ddf_fun_t *mouse_fun; 59 /* DDF mouse function */ 60 ddf_fun_t *wheel_fun; 57 61 } usb_mouse_t; 58 62
Note:
See TracChangeset
for help on using the changeset viewer.