RE: [PATCH 1/1] drm/exynos: Fix potential NULL pointer dereference in exynos_drm_encoder.c

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

 




> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@xxxxxxxxxx]
> Sent: Thursday, November 22, 2012 5:19 PM
> To: Inki Dae
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx; jy0922.shim@xxxxxxxxxxx;
> patches@xxxxxxxxxx
> Subject: Re: [PATCH 1/1] drm/exynos: Fix potential NULL pointer
> dereference in exynos_drm_encoder.c
> 
> [snip]
> >> >> And NULL pointer checking was already done above like below,
> >> >>         if (overlay_ops && overlay_ops->disable)
> >> >>                 overlay_ops->disable(manager->dev, zpos);
> >> > Correct. But that check is applicable only for that one statement
> >> > (overlay_ops->disable(manager->dev, zpos);).
> >> >
> >> > Similar check needs to be added to below 'if' code too.
> >>
> >> What are your comments about this?
> >>
> >
> > Left condition first is checked so as I mentioned before, it doesn't
> need
> > overlay_ops checking because that was checked already. why do you think
> > overlay_ops should be checked again?
> >
> 
> Consider the case when overlay_ops is NULL.
> 
> if (overlay_ops && overlay_ops->disable)
>                  overlay_ops->disable(manager->dev, zpos);
> 
> It does not enter this condition as overlay_ops is NULL and moves to
> the next statement,
> if (overlay_ops->wait_for_vblank) where it gets dereferenced.
> 
> Please note we are not returning back from the first condition if
> overlay_ops is NULL.
> Hence we need to check the condition in second case too.
> 

Ah~ Right. I didn't check it surely. :)

Thanks,
Inki Dae

> --
> With warm regards,
> Sachin

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux