mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
drm/amd/display: Add a dc_state NULL check in dc_state_release
[How] Check wheather state is NULL before releasing it. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Charlene Liu <charlene.liu@amd.com> Acked-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Allen Pan <allen.pan@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
e64b3f55e4
commit
334b56cea5
@ -334,7 +334,8 @@ static void dc_state_free(struct kref *kref)
|
||||
|
||||
void dc_state_release(struct dc_state *state)
|
||||
{
|
||||
kref_put(&state->refcount, dc_state_free);
|
||||
if (state != NULL)
|
||||
kref_put(&state->refcount, dc_state_free);
|
||||
}
|
||||
/*
|
||||
* dc_state_add_stream() - Add a new dc_stream_state to a dc_state.
|
||||
|
Loading…
Reference in New Issue
Block a user