aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason J. Herne <[email protected]>2017-11-07 10:22:32 -0500
committerCornelia Huck <[email protected]>2017-11-08 14:39:53 +0100
commit408358b50deaf59b07c82a7bff8c7e7cce031fae (patch)
tree11e1561de8f6b074df5a48db3884696d26e9370d
parent978fa72e82e375764e6e31e7a721408c5186918f (diff)
s390: vfio-ccw: Do not attempt to free no-op, test and tic cda.
Because we do not make use of the cda (channel data address) for test, no-op ccws no address translation takes place. This means cda could contain a guest address which we do not want to attempt to free. Let's check the command type and skip cda free when it is not needed. For a TIC ccw, ccw->cda points to either a ccw in an existing chain or it points to a whole new allocated chain. In either case the data will be freed when the owning chain is freed. Signed-off-by: Jason J. Herne <[email protected]> Reviewed-by: Dong Jia Shi <[email protected]> Reviewed-by: Pierre Morel <[email protected]> Message-Id: <[email protected]> Reviewed-by: Halil Pasic <[email protected]> Acked-by: Christian Borntraeger <[email protected]> Signed-off-by: Cornelia Huck <[email protected]>
-rw-r--r--drivers/s390/cio/vfio_ccw_cp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c
index d8f98ad9b029..7ebbd8b482f5 100644
--- a/drivers/s390/cio/vfio_ccw_cp.c
+++ b/drivers/s390/cio/vfio_ccw_cp.c
@@ -332,6 +332,8 @@ static void ccwchain_cda_free(struct ccwchain *chain, int idx)
{
struct ccw1 *ccw = chain->ch_ccw + idx;
+ if (ccw_is_test(ccw) || ccw_is_noop(ccw) || ccw_is_tic(ccw))
+ return;
if (!ccw->count)
return;