staging: kpc2000: kpc_dma: Remove additional goto statements
authorSouptick Joarder <jrdr.linux@gmail.com>
Wed, 1 Jul 2020 06:17:44 +0000 (11:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Jul 2020 13:44:26 +0000 (15:44 +0200)
commit95154990a7ae05cef093459b0dd038f12dcd7034
tree34e81b1d040d6733e7ac0e0ff0624ad041ff8e6c
parentab7abbcac07e8d040514e0bd93e9ead30ca3a114
staging: kpc2000: kpc_dma: Remove additional goto statements

As 3 goto level referring to same common code, those can be
accomodated with a single goto level and renameing it to
unpin_pages. Set the -ERRNO when returning partial mapped
pages in more appropriate place.

When dma_map_sg() failed, the previously allocated memory was
not freed properly. This is corrected now.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Bharath Vedartham <linux.bhar@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1593584264-16982-5-git-send-email-jrdr.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/kpc2000/kpc_dma/fileops.c