s390/cio: Fix cleanup when unsupported IDA format is used
A message that is not in the archive (sent off-list or not yet received): [email protected]
Halil Pasic
Acked-byQuoted 4 lines · On Fri, 9 Nov 2018 03:39:29 +0100 Eric Farman <[email protected]> wrote:
Direct returns from within a loop are rude, but it doesn't mean it gets to avoid releasing the memory acquired beforehand.
Signed-off-by Eric Farman <[email protected]>
Acked-by Halil Pasic <[email protected]>
Quoted 24 lines
--- drivers/s390/cio/vfio_ccw_cp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/s390/cio/vfio_ccw_cp.cindexef5ab45d94b3..70a006ba4d05100644 ---a/drivers/s390/cio/vfio_ccw_cp.c
+++b/drivers/s390/cio/vfio_ccw_cp.c(quoted diff) +0
-0@@ -387,8 +387,10 @@ static int ccwchain_calc_length(u64 iova, struct channel_program *cp) * orb specified one of the unsupported formats, wedefer
(quoted diff) +0
-1* checking for IDAWs in unsupported formats to here. */ - if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) &&
ccw_is_idal(ccw))(quoted diff) +1
-0+ if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) &&
ccw_is_idal(ccw)) {(quoted diff) +2
-0+ kfree(p); return -EOPNOTSUPP; + } if ((!ccw_is_chain(ccw)) && (!ccw_is_tic(ccw))) break;