Skip to content

Commit

Permalink
[S390] qdio: call qdio_free also if qdio_shutdown fails
Browse files Browse the repository at this point in the history
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: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Jan Glauber authored and Martin Schwidefsky committed Mar 26, 2009
1 parent c38f960 commit 700e982
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/s390/cio/qdio_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,9 @@ EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc);
* @cdev: associated ccw device
* @how: use halt or clear to shutdown
*
* This function calls qdio_shutdown() for @cdev with method @how
* and on success qdio_free() for @cdev.
* This function calls qdio_shutdown() for @cdev with method @how.
* 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)
{
Expand All @@ -1085,8 +1086,8 @@ int qdio_cleanup(struct ccw_device *cdev, int how)
return -ENODEV;

rc = qdio_shutdown(cdev, how);
if (rc == 0)
rc = qdio_free(cdev);

qdio_free(cdev);
return rc;
}
EXPORT_SYMBOL_GPL(qdio_cleanup);
Expand Down

0 comments on commit 700e982

Please sign in to comment.