drm: bridge: fix wrong pointer passed to PTR_ERR()
Subsystems (5)
PATCH 1/1 drm: bridge: fix wrong pointer passed to PTR_ERR()
PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned.
Reported-by Hulk Robot <[email protected]>
Signed-off-by Qiheng Lin <[email protected]>
--- drivers/gpu/drm/bridge/ite-it66121.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ite-it66121.c +1 -1
@@ -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 ]);
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 <[email protected]>
Quoted 24 lines · Qiheng Lin
PTR_ERRshould access the value just tested byIS_ERR, otherwise the wrong error code will be returned.Reported-by Hulk Robot <[email protected]>Signed-off-by Qiheng Lin <[email protected]>--- drivers/gpu/drm/bridge/ite-it66121.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/bridge/ite-it66121.c +1
-1@@ -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 ]);