diff options
author | Thierry Reding <treding@nvidia.com> | 2013-09-03 02:50:39 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2013-09-03 04:10:11 -0400 |
commit | 03c961ba6d04786c8a7e7df118538a01f442e90b (patch) | |
tree | b2f2a2fdce603585275f87a25934bddb8fc7d310 /drivers/gpu/host1x | |
parent | 745cecc07cee878a5afdda40d13f8b0901a88ebd (diff) |
gpu: host1x: Check for valid host1x pointer
Under rare circumstances it can happen that the host1x driver's .probe()
doesn't finish properly, in which case the device's driver-specific data
will not be set. Instead of crashing in such a situation, propagate the
error to callers of the host1x_get_drm_data() function.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r-- | drivers/gpu/host1x/dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 28e28a23d444..471630299878 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c | |||
@@ -43,7 +43,7 @@ void host1x_set_drm_data(struct device *dev, void *data) | |||
43 | void *host1x_get_drm_data(struct device *dev) | 43 | void *host1x_get_drm_data(struct device *dev) |
44 | { | 44 | { |
45 | struct host1x *host1x = dev_get_drvdata(dev); | 45 | struct host1x *host1x = dev_get_drvdata(dev); |
46 | return host1x->drm_data; | 46 | return host1x ? host1x->drm_data : NULL; |
47 | } | 47 | } |
48 | 48 | ||
49 | void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r) | 49 | void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r) |