drm/amd/display: Fix possible NULL dereference in dc_dmub_srv_cmd_run_list()
We have a NULL check for 'dc_dmub_srv' in dc_dmub_srv_cmd_run_list() but we are dereferencing it before checking. Fix this moving the dereference next to NULL check. This issue is found with Smatch(static analysis tool). Fixes: e97cc04fe0fb ("drm/amd/display: refactor dmub commands into single function") Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
8fa7635058
commit
44407010ce
@ -125,7 +125,7 @@ bool dc_dmub_srv_cmd_run(struct dc_dmub_srv *dc_dmub_srv, union dmub_rb_cmd *cmd
|
|||||||
|
|
||||||
bool dc_dmub_srv_cmd_run_list(struct dc_dmub_srv *dc_dmub_srv, unsigned int count, union dmub_rb_cmd *cmd_list, enum dm_dmub_wait_type wait_type)
|
bool dc_dmub_srv_cmd_run_list(struct dc_dmub_srv *dc_dmub_srv, unsigned int count, union dmub_rb_cmd *cmd_list, enum dm_dmub_wait_type wait_type)
|
||||||
{
|
{
|
||||||
struct dc_context *dc_ctx = dc_dmub_srv->ctx;
|
struct dc_context *dc_ctx;
|
||||||
struct dmub_srv *dmub;
|
struct dmub_srv *dmub;
|
||||||
enum dmub_status status;
|
enum dmub_status status;
|
||||||
int i;
|
int i;
|
||||||
@ -133,6 +133,7 @@ bool dc_dmub_srv_cmd_run_list(struct dc_dmub_srv *dc_dmub_srv, unsigned int coun
|
|||||||
if (!dc_dmub_srv || !dc_dmub_srv->dmub)
|
if (!dc_dmub_srv || !dc_dmub_srv->dmub)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
dc_ctx = dc_dmub_srv->ctx;
|
||||||
dmub = dc_dmub_srv->dmub;
|
dmub = dc_dmub_srv->dmub;
|
||||||
|
|
||||||
for (i = 0 ; i < count; i++) {
|
for (i = 0 ; i < count; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user