Message ID | 20240524030605.2185210-1-nichen@iscas.ac.cn (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/bochs: Add check for drm_simple_display_pipe_init | expand |
diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c index c23c9f0cf49c..31ad2bc4ee22 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -550,13 +550,15 @@ static int bochs_kms_init(struct bochs_device *bochs) bochs->dev->mode_config.funcs = &bochs_mode_funcs; bochs_connector_init(bochs->dev); - drm_simple_display_pipe_init(bochs->dev, + ret = drm_simple_display_pipe_init(bochs->dev, &bochs->pipe, &bochs_pipe_funcs, bochs_formats, ARRAY_SIZE(bochs_formats), NULL, &bochs->connector); + if (ret) + return ret; drm_mode_config_reset(bochs->dev);
Add check for the return value of drm_simple_display_pipe_init() and return the error if it fails in order to catch the error. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> --- drivers/gpu/drm/tiny/bochs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)