Skip to content

Commit 005af85

Browse files
author
Martin Schwidefsky
committed
Merge tag 'vfio-ccw-20181113' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw into fixes
Pull vfio-ccw from Cornelia Huck with the following changes: - Several bugfixes for vfio-ccw
2 parents ccda4af + b89e242 commit 005af85

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

drivers/s390/cio/vfio_ccw_cp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,10 @@ static int ccwchain_calc_length(u64 iova, struct channel_program *cp)
387387
* orb specified one of the unsupported formats, we defer
388388
* checking for IDAWs in unsupported formats to here.
389389
*/
390-
if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) && ccw_is_idal(ccw))
390+
if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) && ccw_is_idal(ccw)) {
391+
kfree(p);
391392
return -EOPNOTSUPP;
393+
}
392394

393395
if ((!ccw_is_chain(ccw)) && (!ccw_is_tic(ccw)))
394396
break;
@@ -528,7 +530,7 @@ static int ccwchain_fetch_direct(struct ccwchain *chain,
528530

529531
ret = pfn_array_alloc_pin(pat->pat_pa, cp->mdev, ccw->cda, ccw->count);
530532
if (ret < 0)
531-
goto out_init;
533+
goto out_unpin;
532534

533535
/* Translate this direct ccw to a idal ccw. */
534536
idaws = kcalloc(ret, sizeof(*idaws), GFP_DMA | GFP_KERNEL);

drivers/s390/cio/vfio_ccw_drv.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "vfio_ccw_private.h"
2323

2424
struct workqueue_struct *vfio_ccw_work_q;
25-
struct kmem_cache *vfio_ccw_io_region;
25+
static struct kmem_cache *vfio_ccw_io_region;
2626

2727
/*
2828
* Helpers
@@ -134,14 +134,14 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)
134134
if (ret)
135135
goto out_free;
136136

137-
ret = vfio_ccw_mdev_reg(sch);
138-
if (ret)
139-
goto out_disable;
140-
141137
INIT_WORK(&private->io_work, vfio_ccw_sch_io_todo);
142138
atomic_set(&private->avail, 1);
143139
private->state = VFIO_CCW_STATE_STANDBY;
144140

141+
ret = vfio_ccw_mdev_reg(sch);
142+
if (ret)
143+
goto out_disable;
144+
145145
return 0;
146146

147147
out_disable:

0 commit comments

Comments
 (0)