video: rockchip: rk322x_lcdc: fix error condition

Change-Id: I1c28a815beb74a7566886aef666454ec1513970b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
Jianqun Xu
2017-04-12 13:55:37 +08:00
committed by Huang, Tao
parent 1319af9010
commit dd9460f593

View 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",