Re: [PATCH] staging: omapdrm: fix crash when freeing bad fb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 24, 2012 at 10:44 AM, Andy Gross <andy.gross@xxxxxx> wrote:
> During unload, don't cleanup the framebuffer if it is not valid.
>
> Signed-off-by: Andy Gross <andy.gross@xxxxxx>

Reviewed-by: Rob Clark <rob.clark@xxxxxxxxxx>

> ---
>  drivers/staging/omapdrm/omap_fbdev.c |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/omapdrm/omap_fbdev.c b/drivers/staging/omapdrm/omap_fbdev.c
> index 11acd4c..8c6ed3b 100644
> --- a/drivers/staging/omapdrm/omap_fbdev.c
> +++ b/drivers/staging/omapdrm/omap_fbdev.c
> @@ -208,7 +208,8 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
>         */
>        ret = omap_gem_get_paddr(fbdev->bo, &paddr, true);
>        if (ret) {
> -               dev_err(dev->dev, "could not map (paddr)!\n");
> +               dev_err(dev->dev,
> +                       "could not map (paddr)!  Skipping framebuffer alloc\n");
>                ret = -ENOMEM;
>                goto fail;
>        }
> @@ -388,8 +389,11 @@ void omap_fbdev_free(struct drm_device *dev)
>
>        fbi = helper->fbdev;
>
> -       unregister_framebuffer(fbi);
> -       framebuffer_release(fbi);
> +       /* only cleanup framebuffer if it is present */
> +       if (fbi) {
> +               unregister_framebuffer(fbi);
> +               framebuffer_release(fbi);
> +       }
>
>        drm_fb_helper_fini(helper);
>
> --
> 1.7.5.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux