lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7d712b16109d3a2c8a5704ad8988f961b71a40b2.camel@mediatek.com>
Date: Tue, 22 Oct 2024 10:05:04 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: Peng Liu (刘鹏) <Peng.Liu@...iatek.com>,
	Mac Shen (沈俊) <Mac.Shen@...iatek.com>,
	"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>, "simona@...ll.ch"
	<simona@...ll.ch>, Jitao Shi (石记涛)
	<jitao.shi@...iatek.com>, LIANKUN YANG (杨连坤)
	<Liankun.Yang@...iatek.com>, "p.zabel@...gutronix.de"
	<p.zabel@...gutronix.de>, "airlied@...il.com" <airlied@...il.com>,
	"msp@...libre.com" <msp@...libre.com>, "matthias.bgg@...il.com"
	<matthias.bgg@...il.com>, "dmitry.osipenko@...labora.com"
	<dmitry.osipenko@...labora.com>, Rex-BC Chen (陳柏辰)
	<Rex-BC.Chen@...iatek.com>, AngeloGioacchino Del Regno
	<angelogioacchino.delregno@...labora.com>
CC: "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: Re: [PATCH v1 1/1] drm/mediatek: Add return value check when reading
 DPCD

Hi, Liankun:

On Mon, 2024-09-30 at 17:17 +0800, Liankun Yang wrote:
> Returns the number of bytes transferred (1) on success.
> Check the return value to confirm that AUX communication is successful.
> 
> Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")

Fixes: d9e6ea02fc3f ("drm/mediatek: dp: Add MT8195 External DisplayPort support")

Regards,
CK

> 
> Signed-off-by: Liankun Yang <liankun.yang@...iatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dp.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
> index d8796a904eca..3cab65345d1e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -2018,6 +2018,7 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
>  	enum drm_connector_status ret = connector_status_disconnected;
>  	bool enabled = mtk_dp->enabled;
>  	u8 sink_count = 0;
> +	size_t value;
>  
>  	if (!mtk_dp->train_info.cable_plugged_in)
>  		return ret;
> @@ -2032,7 +2033,12 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
>  	 * function, we just need to check the HPD connection to check
>  	 * whether we connect to a sink device.
>  	 */
> -	drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
> +	value = drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
> +	if (value < 0) {
> +		drm_err(mtk_dp->drm_dev, "Failed to read DP Sink Count: %zd\n", value);
> +		return ret;
> +	}
> +
>  	if (DP_GET_SINK_COUNT(sink_count))
>  		ret = connector_status_connected;
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ