Skip to content

Commit

Permalink
gpu: host1x: Check for valid host1x pointer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thierry Reding committed Sep 3, 2013
1 parent 745cecc commit 03c961b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/host1x/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void host1x_set_drm_data(struct device *dev, void *data)
void *host1x_get_drm_data(struct device *dev)
{
struct host1x *host1x = dev_get_drvdata(dev);
return host1x->drm_data;
return host1x ? host1x->drm_data : NULL;
}

void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r)
Expand Down

0 comments on commit 03c961b

Please sign in to comment.