[COMMON] phy: usb: check NULL for stablitiy
authorKisang Lee <kisang80.lee@samsung.com>
Fri, 18 May 2018 06:10:25 +0000 (15:10 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:08:54 +0000 (17:08 +0900)
Change-Id: I5c2b5d66519ce62777b12163efba3063fdfbeefb
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
drivers/phy/samsung/phy-exynos-usbdrd3.c

index 5ab61ef8e26da9557ced620e652fc8243f7d0395..bb5a7fcfbf601fa93c6edc737dfc8ddec5ca819f 100644 (file)
@@ -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);