lkml.org 
[lkml]   [2015]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drm/atomic: fix null dereference
On Sat, Jul 11, 2015 at 02:17:49PM -0400, Rob Clark wrote:
> On Sat, Jul 11, 2015 at 1:24 PM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> > We are checking the size of e->event but we were doing it when e is
> > known to be NULL.
>
> nak, this will leak event_space.. since it is a sizeof, it isn't
> actually deref'ing e, but rather just using the static type info, so
> it's ok (although perhaps funny looking)
Agreed, and I just verified the same with an userspace code also.
But i think this will confuse people like me who have started to look
at the drm code to start working with some new drm driver.
what about:
file_priv->event_space += sizeof(struct drm_event_vblank);

It will server the same purpose yet it will not be confusing.

regards
sudip


\
 
 \ /
  Last update: 2015-07-12 08:21    [W:0.619 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site