From 6ade3c67b3617fcd4b4dce24b8b7ee4b1a8c045d Mon Sep 17 00:00:00 2001 From: Kisang Lee Date: Fri, 18 May 2018 15:10:25 +0900 Subject: [PATCH] [COMMON] phy: usb: check NULL for stablitiy Change-Id: I5c2b5d66519ce62777b12163efba3063fdfbeefb Signed-off-by: Kisang Lee --- drivers/phy/samsung/phy-exynos-usbdrd3.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/phy/samsung/phy-exynos-usbdrd3.c b/drivers/phy/samsung/phy-exynos-usbdrd3.c index 5ab61ef8e26d..bb5a7fcfbf60 100644 --- a/drivers/phy/samsung/phy-exynos-usbdrd3.c +++ b/drivers/phy/samsung/phy-exynos-usbdrd3.c @@ -817,6 +817,9 @@ static int exynos_usbdrd_fill_hstune_param(struct exynos_usbdrd_phy *phy_drd, dev_info(dev, "%s hs tune cnt = %d\n", __func__, res[0]); hs_tune_param = devm_kzalloc(dev, size*res[0], GFP_KERNEL); + if (hs_tune_param == NULL) + return -ENOMEM; + phy_drd->usbphy_info.tune_param = hs_tune_param; for_each_child_of_node(node, child) { @@ -863,6 +866,9 @@ static int exynos_usbdrd_fill_sstune_param(struct exynos_usbdrd_phy *phy_drd, dev_info(dev, "%s ss tune cnt = %d\n", __func__, res[0]); ss_tune_param = devm_kzalloc(dev, size*res[0], GFP_KERNEL); + if (ss_tune_param == NULL) + return -ENOMEM; + phy_drd->usbphy_sub_info.tune_param = ss_tune_param; for_each_child_of_node(node, child) { ret = of_property_read_string(child, "tune_name", &name); -- 2.20.1