All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>
Cc: <eric.auger@redhat.com>, <alex.williamson@redhat.com>
Subject: [PATCH -next] vfio: platform: reset: add missing iounmap() on error in vfio_platform_amdxgbe_reset()
Date: Thu, 13 May 2021 13:09:24 +0800	[thread overview]
Message-ID: <20210513050924.627625-1-yangyingliang@huawei.com> (raw)

Add the missing iounmap() before return from vfio_platform_amdxgbe_reset()
in the error handling case.

Fixes: 0990822c9866 ("VFIO: platform: reset: AMD xgbe reset module")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/vfio/platform/reset/vfio_platform_amdxgbe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c b/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
index abdca900802d..c6d823a27bd6 100644
--- a/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
+++ b/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
@@ -61,8 +61,10 @@ static int vfio_platform_amdxgbe_reset(struct vfio_platform_device *vdev)
 	if (!xpcs_regs->ioaddr) {
 		xpcs_regs->ioaddr =
 			ioremap(xpcs_regs->addr, xpcs_regs->size);
-		if (!xpcs_regs->ioaddr)
+		if (!xpcs_regs->ioaddr) {
+			iounmap(xgmac_regs->ioaddr);
 			return -ENOMEM;
+		}
 	}
 
 	/* reset the PHY through MDIO*/
-- 
2.25.1


             reply	other threads:[~2021-05-13  5:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13  5:09 Yang Yingliang [this message]
2021-05-18 21:46 ` [PATCH -next] vfio: platform: reset: add missing iounmap() on error in vfio_platform_amdxgbe_reset() Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210513050924.627625-1-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=alex.williamson@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.