Merge tag 'pci-v3.16-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / nouveau / nouveau_crtc.h
index d1e5890784d759b8807495edd8db9949457536d1..a0534489d23f1c52332f52e270586d814d8abe9a 100644 (file)
@@ -74,7 +74,7 @@ struct nouveau_crtc {
 
 static inline struct nouveau_crtc *nouveau_crtc(struct drm_crtc *crtc)
 {
-       return container_of(crtc, struct nouveau_crtc, base);
+       return crtc ? container_of(crtc, struct nouveau_crtc, base) : NULL;
 }
 
 static inline struct drm_crtc *to_drm_crtc(struct nouveau_crtc *crtc)