From: Daniel Vetter Date: Wed, 19 Nov 2014 17:38:08 +0000 (+0100) Subject: drm/atomic: Don't overrun the connector array when hotplugging X-Git-Tag: omap-for-v3.19/fixes-rc1~80^2~44 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f52b69f1ecfdd7ef6867a257620258c09e569552;p=pandora-kernel.git drm/atomic: Don't overrun the connector array when hotplugging Yet another fallout from not considering DP MST hotplug. With the previous patches we have stable indices, but it might still happen that a connector gets added between when we allocate the array and when we actually add a connector. Especially when we back off due to ww mutex contention or similar issues. So store the sizes of the arrays in struct drm_atomic_state and double check them. We don't really care about races except that we want to use a consistent value, so ACCESS_ONCE is all we need. And if we indeed notice that we'd overrun the array then just give up and restart the entire ioctl. Signed-off-by: Daniel Vetter Reviewed-by: Rob Clark Signed-off-by: Dave Airlie --- Reading git-diff-tree failed