* [PATCH -next] drm: bridge: fix wrong pointer passed to PTR_ERR()
@ 2021-05-14 7:03 Qiheng Lin
2021-05-17 9:01 ` Robert Foss
0 siblings, 1 reply; 2+ messages in thread
From: Qiheng Lin @ 2021-05-14 7:03 UTC (permalink / raw)
To: linqiheng, Phong LE, Neil Armstrong, Andrzej Hajda, Robert Foss,
David Airlie, Daniel Vetter
Cc: Hulk Robot, kernel-janitors, linux-kernel, dri-devel
PTR_ERR should access the value just tested by IS_ERR, otherwise
the wrong error code will be returned.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
---
drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
index d8a60691fd32..6980c9801d0d 100644
--- a/drivers/gpu/drm/bridge/ite-it66121.c
+++ b/drivers/gpu/drm/bridge/ite-it66121.c
@@ -943,7 +943,7 @@ static int it66121_probe(struct i2c_client *client,
ctx->regmap = devm_regmap_init_i2c(client, &it66121_regmap_config);
if (IS_ERR(ctx->regmap)) {
ite66121_power_off(ctx);
- return PTR_ERR(ctx);
+ return PTR_ERR(ctx->regmap);
}
regmap_read(ctx->regmap, IT66121_VENDOR_ID0_REG, &vendor_ids[0]);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] drm: bridge: fix wrong pointer passed to PTR_ERR()
2021-05-14 7:03 [PATCH -next] drm: bridge: fix wrong pointer passed to PTR_ERR() Qiheng Lin
@ 2021-05-17 9:01 ` Robert Foss
0 siblings, 0 replies; 2+ messages in thread
From: Robert Foss @ 2021-05-17 9:01 UTC (permalink / raw)
To: Qiheng Lin
Cc: Neil Armstrong, David Airlie, Hulk Robot, kernel-janitors,
linux-kernel, dri-devel, Phong LE, Andrzej Hajda
Hey Qiheng,
Thanks for submitting this bugfix.
The title of this patch should probably be:
drm: bridge: it66121: fix wrong pointer passed to PTR_ERR()
With this fixed, feel free to add my r-b.
Reviewed-by: Robert Foss <robert.foss@linaro.org>
On Fri, 14 May 2021 at 09:03, Qiheng Lin <linqiheng@huawei.com> wrote:
>
> PTR_ERR should access the value just tested by IS_ERR, otherwise
> the wrong error code will be returned.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
> ---
> drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
> index d8a60691fd32..6980c9801d0d 100644
> --- a/drivers/gpu/drm/bridge/ite-it66121.c
> +++ b/drivers/gpu/drm/bridge/ite-it66121.c
> @@ -943,7 +943,7 @@ static int it66121_probe(struct i2c_client *client,
> ctx->regmap = devm_regmap_init_i2c(client, &it66121_regmap_config);
> if (IS_ERR(ctx->regmap)) {
> ite66121_power_off(ctx);
> - return PTR_ERR(ctx);
> + return PTR_ERR(ctx->regmap);
> }
>
> regmap_read(ctx->regmap, IT66121_VENDOR_ID0_REG, &vendor_ids[0]);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-17 9:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 7:03 [PATCH -next] drm: bridge: fix wrong pointer passed to PTR_ERR() Qiheng Lin
2021-05-17 9:01 ` Robert Foss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).