提交 700e982f 编写于 作者: J Jan Glauber 提交者: Martin Schwidefsky

[S390] qdio: call qdio_free also if qdio_shutdown fails

qdio_cleanup is a wrapper function that should call qdio_shutdown and
qdio_free. qdio_free was not called if an error occured in qdio_shutdown
resulting in a missing free of allocated resources.

Call qdio_free regardless of the return value of qdio_shutdown.
Signed-off-by: NJan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 c38f9608
...@@ -1073,8 +1073,9 @@ EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc); ...@@ -1073,8 +1073,9 @@ EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc);
* @cdev: associated ccw device * @cdev: associated ccw device
* @how: use halt or clear to shutdown * @how: use halt or clear to shutdown
* *
* This function calls qdio_shutdown() for @cdev with method @how * This function calls qdio_shutdown() for @cdev with method @how.
* and on success qdio_free() for @cdev. * and qdio_free(). The qdio_free() return value is ignored since
* !irq_ptr is already checked.
*/ */
int qdio_cleanup(struct ccw_device *cdev, int how) int qdio_cleanup(struct ccw_device *cdev, int how)
{ {
...@@ -1085,8 +1086,8 @@ int qdio_cleanup(struct ccw_device *cdev, int how) ...@@ -1085,8 +1086,8 @@ int qdio_cleanup(struct ccw_device *cdev, int how)
return -ENODEV; return -ENODEV;
rc = qdio_shutdown(cdev, how); rc = qdio_shutdown(cdev, how);
if (rc == 0)
rc = qdio_free(cdev); qdio_free(cdev);
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(qdio_cleanup); EXPORT_SYMBOL_GPL(qdio_cleanup);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册