[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V2 04/13] xen: close evtchn port if binding to irq fails



>>> On 04.02.13 at 18:23, Wei Liu <wei.liu2@xxxxxxxxxx> wrote:
> --- a/drivers/xen/evtchn.c
> +++ b/drivers/xen/evtchn.c
> @@ -269,6 +269,15 @@ static int evtchn_bind_to_user(struct per_user_data *u, 
> int port)
>                                      u->name, (void *)(unsigned long)port);
>       if (rc >= 0)
>               rc = evtchn_make_refcounted(port);
> +     else {
> +             /* bind failed, should close the port now */
> +             struct evtchn_close close;
> +             close.port = port;
> +             if (port != 0 && /* port 0 is never used */

If the port == 0 case really needs handling here (didn't look at
the surrounding code), this ought to be done with a "else if()"
at the top of this change imo.

Jan

> +                 HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
> +                     BUG();
> +             set_port_user(port, NULL);
> +     }
>  
>       return rc;
>  }



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.