Skip to content

Commit 03c961b

Browse files
committed
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 <[email protected]>
1 parent 745cecc commit 03c961b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/host1x/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void host1x_set_drm_data(struct device *dev, void *data)
4343
void *host1x_get_drm_data(struct device *dev)
4444
{
4545
struct host1x *host1x = dev_get_drvdata(dev);
46-
return host1x->drm_data;
46+
return host1x ? host1x->drm_data : NULL;
4747
}
4848

4949
void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r)

0 commit comments

Comments
 (0)