Commit 1452b09d authored by Chrysostomos Nanakos's avatar Chrysostomos Nanakos

Handle failed XSEG request on close

parent b665e95f
...@@ -390,8 +390,8 @@ static int tdarchipelago_close(td_driver_t *driver) ...@@ -390,8 +390,8 @@ static int tdarchipelago_close(td_driver_t *driver)
struct xseg_request *req = xseg_get_request(xseg, srcport, vportno, X_ALLOC); struct xseg_request *req = xseg_get_request(xseg, srcport, vportno, X_ALLOC);
r = xseg_prep_request(xseg, req, targetlen, 0); r = xseg_prep_request(xseg, req, targetlen, 0);
if(r < 0) { if(r < 0) {
xseg_put_request(xseg, req, srcport);
DPRINTF("tdarchipelago_close(): Cannot prepare close request."); DPRINTF("tdarchipelago_close(): Cannot prepare close request.");
goto err_exit;
} }
char *target = xseg_get_target(xseg, req); char *target = xseg_get_target(xseg, req);
...@@ -404,16 +404,17 @@ static int tdarchipelago_close(td_driver_t *driver) ...@@ -404,16 +404,17 @@ static int tdarchipelago_close(td_driver_t *driver)
if(p == NoPort) { if(p == NoPort) {
xseg_put_request(xseg, req, srcport); xseg_put_request(xseg, req, srcport);
DPRINTF("tdarchipelago_close(): Cannot submit close request."); DPRINTF("tdarchipelago_close(): Cannot submit close request.");
goto err_exit;
} }
xseg_signal(xseg, p); xseg_signal(xseg, p);
r = wait_reply(req); r = wait_reply(req);
if(r < 0) { if(r < 0)
xseg_put_request(xseg, req, srcport);
DPRINTF("tdarchipelago_close(): wait_reply() error."); DPRINTF("tdarchipelago_close(): wait_reply() error.");
}
xseg_put_request(xseg, req, srcport); xseg_put_request(xseg, req, srcport);
err_exit:
xseg_leave_dynport(xseg, port); xseg_leave_dynport(xseg, port);
xseg_leave(xseg); xseg_leave(xseg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment