drm/amd/display: Trigger bug when allocation fails.
Subsystems (3)
PATCH 1/1 drm/amd/display: Trigger bug when allocation fails.
If the allocation fails in amdgpu_dm_connector_funcs_reset() the API cannot continue so trigger a BUG_ON.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -2722,6 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)kfree (state); state =kzalloc (sizeof (*state),GFP_KERNEL ); +BUG_ON (state ==NULL );if (state) { state->scaling =RMX_OFF ;
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Andrey Grodzovsky
Reviewed-byQuoted 13 lines · Tom St Denis
If the allocation fails in
amdgpu_dm_connector_funcs_reset()the API cannot continue so trigger aBUG_ON.Signed-off-by Tom St Denis <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) · line 2728
Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -2722,6 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)kfree (state); state =kzalloc (sizeof (*state),GFP_KERNEL ); +BUG_ON (state ==NULL );if (state) { state->scaling =RMX_OFF ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 2 lines · Tom St Denis
If the allocation fails in
amdgpu_dm_connector_funcs_reset()the API cannot continue so trigger aBUG_ON.
That seems questionable to be honest. The drm_atomic_helper version of this function ends up setting connector->state = NULL; in this case.
Cheers,
Nicolai
Quoted 19 lines
Signed-off-by Tom St Denis <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -2722,6 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)kfree (state); state =kzalloc (sizeof (*state),GFP_KERNEL ); +BUG_ON (state ==NULL );if (state) { state->scaling =RMX_OFF ;
Signature · 6 lines
Lerne, wie die Welt wirklich ist, Aber vergiss niemals, wie sie sein sollte. _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): d035e531-09e5-0307-4340-7c96685dc60e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Harry Wentland
Acked-byQuoted 6 lines · Nicolai Hähnle
Quoted 2 lines · Tom St Denis
If the allocation fails in
amdgpu_dm_connector_funcs_reset()the API cannot continue so trigger aBUG_ON.That seems questionable to be honest. The
drm_atomic_helperversion of this function ends up settingconnector->state= NULL; in this case.
If we feel this BUG_ON is a priority this patch is
Ultimately it wouldn't be hard to just copy/pase the drm_atomic_helper version, plus the amdgpu_dm specific stuff. That sounds like the more correct approach to me and will keep us from weird behavior should Daniel do another drive-by-refactor in the atomic framework.
Harry
Quoted 9 lines
Cheers,
NicolaiQuoted 6 lines
Signed-off-by Tom St Denis <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 1 +1 file changed, 1 insertion(+)
Quoted 13 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) · line 2727
Quoted 11 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -2722,6 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) kfree(state); state = kzalloc(sizeof(*state), GFP_KERNEL); + BUG_ON(state == NULL); if (state) { state->scaling = RMX_OFF;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 5 lines · Nicolai Hähnle
Quoted 2 lines · Tom St Denis
If the allocation fails in
amdgpu_dm_connector_funcs_reset()the API cannot continue so trigger aBUG_ON.That seems questionable to be honest. The
drm_atomic_helperversion of this function ends up settingconnector->state= NULL; in this case.
I see it now, it will propagate back to user mode as -ENOMEM, so i guess it's good just set it as NULL.
Thanks,
Andrey
Quoted 10 lines
Cheers,
NicolaiQuoted 6 lines
Signed-off-by Tom St Denis <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+)
Quoted 14 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c void amdgpu_dm_connector_funcs_reset(struct · line 2728
Quoted 12 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -2722,6 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)kfree (state ); state =kzalloc (sizeof (*state),GFP_KERNEL ); +BUG_ON (state ==NULL );if (state) { state->scaling =RMX_OFF ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 49649733-17eb-4d9a-a523-340be9a6a0e2-5C7GfCeVMHo@public.gmane.org
I'm ok with not pushing my commit and simply adding an else branch that sets the pointer to NULL.
(maybe put a WARN_ON to give context?)
Tom
Quoted 7 lines · Andrey Grodzovsky
Quoted 4 lines · Nicolai Hähnle
Quoted 2 lines · Tom St Denis
If the allocation fails in
amdgpu_dm_connector_funcs_reset()the API cannot continue so trigger aBUG_ON.
Quoted 32 lines
Quoted 1 line
That seems questionable to be honest. The
drm_atomic_helperversion of this function ends up settingconnector->state= NULL; in this case.I see it now, it will propagate back to user mode as
-ENOMEM, so i guess it's good just set it as NULL.Thanks,
AndreyQuoted 24 lines
Cheers,
NicolaiQuoted 18 lines
Signed-off-by Tom St Denis <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 1 +1 file changed, 1 insertion(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -2722,6 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) kfree(state); state = kzalloc(sizeof(*state), GFP_KERNEL); + BUG_ON(state == NULL); if (state) { state->scaling = RMX_OFF;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 13db5809-f805-7289-f901-3d675b24faf5-5C7GfCeVMHo@public.gmane.org
Quoted 3 lines · Tom St Denis
I'm ok with not pushing my commit and simply adding an else branch that sets the pointer to NULL.
(maybe put a
WARN_ONto give context?)
Seems reasonable to me.
Harry ?
Andrey
Quoted 44 lines
Tom
Quoted 39 lines · Andrey Grodzovsky
Quoted 5 lines · Nicolai Hähnle
Quoted 2 lines · Tom St Denis
If the allocation fails in
amdgpu_dm_connector_funcs_reset()the API cannot continue so trigger aBUG_ON.That seems questionable to be honest. The
drm_atomic_helperversion of this function ends up settingconnector->state= NULL; in this case.I see it now, it will propagate back to user mode as
-ENOMEM, so i guess it's good just set it as NULL.Thanks,
AndreyQuoted 24 lines
Cheers,
NicolaiQuoted 18 lines
Signed-off-by Tom St Denis <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -2722,6 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)kfree (state ); state =kzalloc (sizeof (*state),GFP_KERNEL ); +BUG_ON (state ==NULL );if (state) { state->scaling =RMX_OFF ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): ef080a5a-f1f2-e386-defd-c5c72fd61d33-5C7GfCeVMHo@public.gmane.org
Quoted 10 lines · Andrey Grodzovsky
Quoted 3 lines · Tom St Denis
I'm ok with not pushing my commit and simply adding an else branch that sets the pointer to NULL.
(maybe put a
WARN_ONto give context?)Seems reasonable to me.
Harry ?
Sure.
Harry
Quoted 46 lines
Andrey
Quoted 43 lines
Tom
Quoted 38 lines · Andrey Grodzovsky
Quoted 5 lines · Nicolai Hähnle
Quoted 2 lines · Tom St Denis
If the allocation fails in
amdgpu_dm_connector_funcs_reset()the API cannot continue so trigger aBUG_ON.That seems questionable to be honest. The
drm_atomic_helperversion of this function ends up settingconnector->state= NULL; in this case.I see it now, it will propagate back to user mode as
-ENOMEM, so i guess it's good just set it as NULL.Thanks,
AndreyQuoted 23 lines
Cheers,
NicolaiQuoted 17 lines
Signed-off-by Tom St Denis <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 1 +1 file changed, 1 insertion(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -2722,6 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) kfree(state); state = kzalloc(sizeof(*state), GFP_KERNEL); + BUG_ON(state == NULL); if (state) { state->scaling = RMX_OFF;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx