Skip to content

Commit

Permalink
s390/cio: Fix cleanup of pfn_array alloc failure
Browse files Browse the repository at this point in the history
[ Upstream commit 806212f91c874b24cf9eb4a9f180323671b6c5ed ]

If pfn_array_alloc fails somehow, we need to release the pfn_array_table
that was malloc'd earlier.

Signed-off-by: Eric Farman <[email protected]>
Message-Id: <[email protected]>
Acked-by: Halil Pasic <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
efarman authored and gregkh committed Dec 17, 2018
1 parent 00bac44 commit a4f2111
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/cio/vfio_ccw_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static int ccwchain_fetch_direct(struct ccwchain *chain,

ret = pfn_array_alloc_pin(pat->pat_pa, cp->mdev, ccw->cda, ccw->count);
if (ret < 0)
goto out_init;
goto out_unpin;

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

0 comments on commit a4f2111

Please sign in to comment.