All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Anthony.Koo-5C7GfCeVMHo@public.gmane.org
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [bug report] drm/amd/display: Fix exception from AUX acquire failure
Date: Wed, 2 Oct 2019 14:58:14 +0300	[thread overview]
Message-ID: <20191002115814.GA10545@mwanda> (raw)

Hello Anthony Koo,

The patch dcf1a988678e: "drm/amd/display: Fix exception from AUX
acquire failure" from Feb 6, 2019, leads to the following static
checker warning:

	drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:108 dm_dp_aux_transfer()
	error: uninitialized symbol 'operation_result'.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c
    82  static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
    83                                    struct drm_dp_aux_msg *msg)
    84  {
    85          ssize_t result = 0;
    86          struct aux_payload payload;
    87          enum aux_channel_operation_result operation_result;
    88  
    89          if (WARN_ON(msg->size > 16))
    90                  return -E2BIG;
    91  
    92          payload.address = msg->address;
    93          payload.data = msg->buffer;
    94          payload.length = msg->size;
    95          payload.reply = &msg->reply;
    96          payload.i2c_over_aux = (msg->request & DP_AUX_NATIVE_WRITE) == 0;
    97          payload.write = (msg->request & DP_AUX_I2C_READ) == 0;
    98          payload.mot = (msg->request & DP_AUX_I2C_MOT) != 0;
    99          payload.defer_delay = 0;
   100  
   101          result = dc_link_aux_transfer_raw(TO_DM_AUX(aux)->ddc_service, &payload,
   102                                        &operation_result);
                                              ^^^^^^^^^^^^^^^^^
The patch adds a new return where "operation_result" isn't initialized.

   103  
   104          if (payload.write)
   105                  result = msg->size;
   106  
   107          if (result < 0)
   108                  switch (operation_result) {
                                ^^^^^^^^^^^^^^^^

   109                  case AUX_CHANNEL_OPERATION_SUCCEEDED:
   110                          break;
   111                  case AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON:
   112                  case AUX_CHANNEL_OPERATION_FAILED_REASON_UNKNOWN:
   113                          result = -EIO;
   114                          break;
   115                  case AUX_CHANNEL_OPERATION_FAILED_INVALID_REPLY:
   116                          result = -EBUSY;
   117                          break;
   118                  case AUX_CHANNEL_OPERATION_FAILED_TIMEOUT:
   119                          result = -ETIMEDOUT;
   120                          break;
   121                  }
   122  
   123          return result;
   124  }

regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

             reply	other threads:[~2019-10-02 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 11:58 Dan Carpenter [this message]
2019-10-02 14:00 ` [bug report] drm/amd/display: Fix exception from AUX acquire failure Koo, Anthony

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191002115814.GA10545@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=Anthony.Koo-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.