OSDN Git Service

drm_hwcomposer: Initialize buffer_ pointer to NULL
authorJohn Stultz <john.stultz@linaro.org>
Thu, 28 Feb 2019 05:35:03 +0000 (21:35 -0800)
committerJohn Stultz <john.stultz@linaro.org>
Thu, 28 Feb 2019 17:22:05 +0000 (09:22 -0800)
commit6230703e2a00b79e551460b958d2496934726e9e
tree5b134952e60530dc632d74493577d15eafb1abfb
parent65c988de054ffa494ffcfebc71c41044ed7a2a25
drm_hwcomposer: Initialize buffer_ pointer to NULL

In some cases, we've seen drm_hwcomposer start to try to
compose frames before anything has called SetClientTarget().

This seems to be some sort of a race, which for some reason
we only see with certain dummy HDMI dongles (which provide
fake EDID data) which allow our lab machines to run headless.
I'm still trying to understand more about why this happens
only in this case.

The net of the issue is we see CreateComposition() being called,
which adds the client_layer_ to the zmap. Then it creates the
DrmHwcLayers copying the non-initialized buffer_ value as the
sf_handle.

This then later causes a crash in ImportBuffer() when we
traverse the non-null (but invalid) hnd value.

Thus, this patch simply initilizes the buffer_ pointer to NULL
so that we error out properly in the case of the race.

Reported-by: YongQin Liu <yongqin.liu@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I5fde3fccde86519edb04e61cbc2842eda395ade4
drmhwctwo.h