rk fb:
authorzwl <zwl@rockchips.com>
Fri, 17 Oct 2014 03:04:11 +0000 (11:04 +0800)
committerzwl <zwl@rockchips.com>
Fri, 17 Oct 2014 03:05:48 +0000 (11:05 +0800)
* fix get share dma buf fd failed when stop and start system

Signed-off-by: zwl <zwl@rock-chips.com>
drivers/video/rockchip/rk_fb.c

index b8cdcdfb2e4e2891183f25686bc66682ad0699fb..c9c775db3592359a5befdc65bf39856a6cf364b5 100755 (executable)
@@ -2634,9 +2634,15 @@ static int rk_fb_ioctl(struct fb_info *info, unsigned int cmd,
                }
        case RK_FBIOGET_DMABUF_FD:
                {
-                       int fd =
-                           ion_share_dma_buf_fd(rk_fb->ion_client,
-                                                win->area[0].ion_hdl);
+                       int fd = -1;
+
+                       if (IS_ERR_OR_NULL(fb_par->ion_hdl)) {
+                               dev_err(info->dev,
+                                       "get dma_buf fd failed,ion handle is err\n");
+                               return PTR_ERR(fb_par->ion_hdl);
+                       }
+                       fd = ion_share_dma_buf_fd(rk_fb->ion_client,
+                                                 fb_par->ion_hdl);
                        if (fd < 0) {
                                dev_err(info->dev,
                                        "ion_share_dma_buf_fd failed\n");