Skip to content

Commit 44084ef

Browse files
insuyundanvet
authored andcommitted
ch7006: correctly handling failed allocation
Since drm_property_create_range can be failed in memory pressure, it needs to be checked and return -ENOMEM. Signed-off-by: Insu Yun <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 14d2000 commit 44084ef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/i2c/ch7006_drv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ static int ch7006_encoder_create_resources(struct drm_encoder *encoder,
253253
drm_mode_create_tv_properties(dev, NUM_TV_NORMS, ch7006_tv_norm_names);
254254

255255
priv->scale_property = drm_property_create_range(dev, 0, "scale", 0, 2);
256+
if (!priv->scale_property)
257+
return -ENOMEM;
256258

257259
drm_object_attach_property(&connector->base, conf->tv_select_subconnector_property,
258260
priv->select_subconnector);

0 commit comments

Comments
 (0)