video: rockchip: rk322x_lcdc: fix error condition
authorJianqun Xu <jay.xu@rock-chips.com>
Wed, 12 Apr 2017 05:55:37 +0000 (13:55 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 17 Apr 2017 09:04:13 +0000 (17:04 +0800)
Change-Id: I1c28a815beb74a7566886aef666454ec1513970b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
drivers/video/rockchip/lcdc/rk322x_lcdc.c

index 08b8ddd80bd2851a2b93472179beefa968896cf0..b174fe409e14a27df95db668ee37f92334d22772 100644 (file)
@@ -3478,7 +3478,7 @@ static int vop_get_backlight_device(struct rk_lcdc_driver *dev_drv)
        max = length / sizeof(u32);
        last = max - 1;
        brightness_levels = kmalloc(256, GFP_KERNEL);
-       if (brightness_levels)
+       if (!brightness_levels)
                return -ENOMEM;
 
        if (!of_property_read_u32_array(backlight, "brightness-levels",