Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/proto/mousedev.c

    rcce8a83 redb3cf2  
    5454        /** Link to generic mouse device */
    5555        mouse_dev_t *mouse_dev;
    56        
    57         /** Session to mouse device */
    58         async_sess_t *sess;
    5956} mousedev_t;
    6057
     
    7269static void mousedev_destroy(mousedev_t *mousedev)
    7370{
    74         if (mousedev->sess != NULL)
    75                 async_hangup(mousedev->sess);
    76        
    7771        free(mousedev);
    7872}
     
    8983               
    9084                if (!IPC_GET_IMETHOD(call)) {
    91                         /* XXX Handle hangup */
     85                        mousedev_destroy(mousedev);
    9286                        return;
    9387                }
     
    9791                switch (IPC_GET_IMETHOD(call)) {
    9892                case MOUSEEV_MOVE_EVENT:
    99                         mouse_push_event_move(mousedev->mouse_dev, IPC_GET_ARG1(call),
    100                             IPC_GET_ARG2(call));
     93                        mouse_push_event_move(mousedev->mouse_dev,
     94                            IPC_GET_ARG1(call), IPC_GET_ARG2(call),
     95                            IPC_GET_ARG3(call));
    10196                        retval = EOK;
    10297                        break;
    10398                case MOUSEEV_BUTTON_EVENT:
    104                         mouse_push_event_button(mousedev->mouse_dev, IPC_GET_ARG1(call),
    105                             IPC_GET_ARG2(call));
     99                        mouse_push_event_button(mousedev->mouse_dev,
     100                            IPC_GET_ARG1(call), IPC_GET_ARG2(call));
    106101                        retval = EOK;
    107102                        break;
     
    129124                printf("%s: Failed allocating device structure for '%s'.\n",
    130125                    NAME, mdev->svc_name);
     126                async_hangup(sess);
    131127                return -1;
    132128        }
    133        
    134         mousedev->sess = sess;
    135129       
    136130        async_exch_t *exch = async_exchange_begin(sess);
     
    139133                    mdev->svc_name);
    140134                mousedev_destroy(mousedev);
     135                async_hangup(sess);
    141136                return -1;
    142137        }
     
    144139        int rc = async_connect_to_me(exch, 0, 0, 0, mousedev_callback_conn, mousedev);
    145140        async_exchange_end(exch);
     141        async_hangup(sess);
    146142       
    147143        if (rc != EOK) {
Note: See TracChangeset for help on using the changeset viewer.