From: Daehwan Jung Date: Mon, 11 Mar 2019 07:50:03 +0000 (+0900) Subject: [RAMEN9610-14252] [9610] usb: phy: add iounmap and NULL check of ioremap X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4e1bcf9b834c9849c44474bf16dc7df40cad9c10;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [RAMEN9610-14252] [9610] usb: phy: add iounmap and NULL check of ioremap Change-Id: Ieb62e64bfd9ff925740b02197cdbe8b0d0928899 Signed-off-by: Daehwan Jung --- diff --git a/drivers/phy/samsung/phy-exynos-usbdrd3.c b/drivers/phy/samsung/phy-exynos-usbdrd3.c index 95ead4db0a98..ec242cac56cf 100644 --- a/drivers/phy/samsung/phy-exynos-usbdrd3.c +++ b/drivers/phy/samsung/phy-exynos-usbdrd3.c @@ -416,6 +416,11 @@ static void exynos_usbdrd_usb_txco_enable(struct phy_usb_instance *inst, int on) u32 reg; base = ioremap(0x11860000, 0x100000); + if(!base) { + dev_err(phy_drd->dev, "[%s] Unable to map I/O memory\n", + __func__); + return; + } reg = readl(base + EXYNOS_USBDEV_PHY_CONTROL); dev_info(phy_drd->dev, "[%s] ++USB DEVCTRL reg 0x%x \n", @@ -431,6 +436,7 @@ static void exynos_usbdrd_usb_txco_enable(struct phy_usb_instance *inst, int on) reg = readl(base + EXYNOS_USBDEV_PHY_CONTROL); dev_info(phy_drd->dev, "[%s] --USB DEVCTRL reg 0x%x \n", __func__, reg); + iounmap(base); } static void exynos_usbdrd_pipe3_phy_isol(struct phy_usb_instance *inst,