[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <455d9474-253d-7f1c-f312-08dffad242f3@samsung.com>
Date: Tue, 29 Jan 2019 09:40:33 +0100
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: Yizhuo <yzhai003@....edu>
Cc: csong@...ucr.edu, zhiyunq@...ucr.edu,
Inki Dae <inki.dae@...sung.com>,
Joonyoung Shim <jy0922.shim@...sung.com>,
Seung-Woo Kim <sw0312.kim@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
David Airlie <airlied@...ux.ie>, Kukjin Kim <kgene@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/exynos: gsc: Variable "gscblk_cfg" in function
gsc_set_gscblk_fimd_wb() could be uninitialized
Hi
On 2019-01-28 19:28, Yizhuo wrote:
> In function gsc_set_gscblk_fimd_wb(), local variable "gscblk_cfg"
> could be uninitialized of function regmap_read returns -EINVAL.
> However, this value will be write to the register after "or"
> operation. This is potentially unsafe.
>
> Signed-off-by: Yizhuo <yzhai003@....edu>
> ---
> drivers/gpu/drm/exynos/exynos_drm_gsc.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> index 0506b2b17ac1..b1d0f974fe80 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
> @@ -441,11 +441,16 @@ static int gsc_sw_reset(struct gsc_context *ctx)
> static void gsc_set_gscblk_fimd_wb(struct gsc_context *ctx, bool enable)
This function has been completely removed in mainline kernel by commit
8b7d3ec83aba ("drm/exynos: gsc: Convert driver to IPP v2 core API"), so
there is no need for any fix anymore.
> {
> unsigned int gscblk_cfg;
> + int ret;
>
> if (!ctx->sysreg)
> return;
>
> - regmap_read(ctx->sysreg, SYSREG_GSCBLK_CFG1, &gscblk_cfg);
> + ret = regmap_read(ctx->sysreg, SYSREG_GSCBLK_CFG1, &gscblk_cfg);
> + if (ret) {
> + DRM_ERROR("gsc: Fail to read system register\n");
> + return;
> + }
>
> if (enable)
> gscblk_cfg |= GSC_BLK_DISP1WB_DEST(ctx->id) |
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Powered by blists - more mailing lists