From: Lyude Paul <cpaul@redhat.com>
To: Imre Deak <imre.deak@intel.com>, dri-devel@lists.freedesktop.org
Cc: Dave Airlie <airlied@redhat.com>
Subject: Re: [2/3] drm/mst: Fix error handling during MST sideband message reception
Date: Thu, 12 May 2016 18:00:51 -0400 [thread overview]
Message-ID: <1463090451.28548.2.camel@redhat.com> (raw)
In-Reply-To: <1463058040-31828-3-git-send-email-imre.deak@intel.com>
On Thu, 2016-05-12 at 16:00 +0300, Imre Deak wrote:
> Handle any error due to partial reads, timeouts etc. to avoid parsing
> uninitialized data subsequently. Also bail out if the parsing itself
> fails.
>
> CC: Dave Airlie <airlied@redhat.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index a13edf5..12c0ab3 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -2204,11 +2204,19 @@ static void drm_dp_get_one_sb_msg(struct
> drm_dp_mst_topology_mgr *mgr, bool up)
> ret = drm_dp_dpcd_read(mgr->aux, basereg + curreply,
> replyblock, len);
> if (ret != len) {
> - DRM_DEBUG_KMS("failed to read a chunk\n");
> + DRM_DEBUG_KMS("failed to read a chunk (len %d, ret
> %d)\n",
> + len, ret);
> +
I'd get rid of the whitespace here…
> + return;
> }
> +
> ret = drm_dp_sideband_msg_build(msg, replyblock, len, false);
> - if (ret == false)
> + if (!ret) {
> DRM_DEBUG_KMS("failed to build sideband msg\n");
> +
And here, to match the rest of the file. Otherwise looks good to me;
Reviewed-by: Lyude <cpaul@redhat.com>
> + return;
> + }
> +
> curreply += len;
> replylen -= len;
> }
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-05-12 22:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 13:00 [PATCH 0/3] drm: Fix/annotate better a few error paths Imre Deak
2016-05-12 13:00 ` [PATCH 1/3] drm: Tune up error message during format->bpp/cpp conversion Imre Deak
2016-05-12 13:10 ` Ville Syrjälä
2016-05-12 13:43 ` Imre Deak
2016-05-12 13:52 ` Ville Syrjälä
2016-05-12 14:00 ` Imre Deak
2016-05-12 14:02 ` Daniel Vetter
2016-05-12 15:28 ` [PATCH v2 1/3] drm: Tune up error message for incorrect plane/format combinations Imre Deak
2016-05-12 13:00 ` [PATCH 2/3] drm/mst: Fix error handling during MST sideband message reception Imre Deak
2016-05-12 22:00 ` Lyude Paul [this message]
2016-05-13 14:31 ` [PATCH v2 " Imre Deak
2016-05-12 13:00 ` [PATCH 3/3] drm: Avoid dereferencing a NULL mstb in drm_dp_mst_handle_up_req() Imre Deak
2017-07-17 12:10 ` Imre Deak
2017-07-17 15:33 ` Lyude Paul
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=1463090451.28548.2.camel@redhat.com \
--to=cpaul@redhat.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=imre.deak@intel.com \
/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.