mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm/tegra: Make CRTC upcasting safer
When upcasting a NULL CRTC object, propagate the NULL pointer instead of some invalid pointer. This allows subsequent code to check that the cast object is valid. Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
43dd5554fc
commit
37826519c4
1 changed files with 1 additions and 1 deletions
|
@ -116,7 +116,7 @@ host1x_client_to_dc(struct host1x_client *client)
|
||||||
|
|
||||||
static inline struct tegra_dc *to_tegra_dc(struct drm_crtc *crtc)
|
static inline struct tegra_dc *to_tegra_dc(struct drm_crtc *crtc)
|
||||||
{
|
{
|
||||||
return container_of(crtc, struct tegra_dc, base);
|
return crtc ? container_of(crtc, struct tegra_dc, base) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void tegra_dc_writel(struct tegra_dc *dc, unsigned long value,
|
static inline void tegra_dc_writel(struct tegra_dc *dc, unsigned long value,
|
||||||
|
|
Loading…
Add table
Reference in a new issue