Commit 3f397cd
drm/amd/display: Add NULL pointer checks in dm_force_atomic_commit()
This commit updates the dm_force_atomic_commit function to replace the
usage of PTR_ERR_OR_ZERO with IS_ERR for checking error states after
retrieving the Connector (drm_atomic_get_connector_state), CRTC
(drm_atomic_get_crtc_state), and Plane (drm_atomic_get_plane_state)
states.
The function utilized PTR_ERR_OR_ZERO for error checking. However, this
approach is inappropriate in this context because the respective
functions do not return NULL; they return pointers that encode errors.
This change ensures that error pointers are properly checked using
IS_ERR before attempting to dereference.
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Cc: Tom Chung <chiahsuan.chung@amd.com>
Cc: Roman Li <roman.li@amd.com>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>1 parent 42a6667 commit 3f397cd
1 file changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10602 | 10602 | | |
10603 | 10603 | | |
10604 | 10604 | | |
10605 | | - | |
10606 | | - | |
| 10605 | + | |
| 10606 | + | |
| 10607 | + | |
10607 | 10608 | | |
| 10609 | + | |
10608 | 10610 | | |
10609 | 10611 | | |
10610 | 10612 | | |
10611 | 10613 | | |
10612 | | - | |
10613 | | - | |
| 10614 | + | |
| 10615 | + | |
| 10616 | + | |
10614 | 10617 | | |
| 10618 | + | |
10615 | 10619 | | |
10616 | 10620 | | |
10617 | 10621 | | |
10618 | 10622 | | |
10619 | 10623 | | |
10620 | 10624 | | |
10621 | 10625 | | |
10622 | | - | |
10623 | | - | |
| 10626 | + | |
| 10627 | + | |
| 10628 | + | |
10624 | 10629 | | |
| 10630 | + | |
10625 | 10631 | | |
10626 | 10632 | | |
10627 | 10633 | | |
| |||
0 commit comments