From: Zhen Lei Date: Sat, 15 May 2021 06:58:30 +0000 (+0200) Subject: media: tc358743: Fix error return code in tc358743_probe_of() X-Git-Tag: v5.4.132~195 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ffc483de3ecb4a0b509e51fe70736ca868af3e6b;p=users%2Fdwmw2%2Flinux.git media: tc358743: Fix error return code in tc358743_probe_of() [ Upstream commit a6b1e7093f0a099571fc8836ab4a589633f956a8 ] When the CSI bps per lane is not in the valid range, an appropriate error code -EINVAL should be returned. However, we currently do not explicitly assign this error code to 'ret'. As a result, 0 was incorrectly returned. Fixes: 256148246852 ("[media] tc358743: support probe from device tree") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 114c084c4aec1..76c443067ec2d 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1973,6 +1973,7 @@ static int tc358743_probe_of(struct tc358743_state *state) bps_pr_lane = 2 * endpoint.link_frequencies[0]; if (bps_pr_lane < 62500000U || bps_pr_lane > 1000000000U) { dev_err(dev, "unsupported bps per lane: %u bps\n", bps_pr_lane); + ret = -EINVAL; goto disable_clk; }