]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: tc358743: Fix error return code in tc358743_probe_of()
authorZhen Lei <thunder.leizhen@huawei.com>
Sat, 15 May 2021 06:58:30 +0000 (08:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:22:33 +0000 (16:22 +0200)
[ 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 <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/tc358743.c

index 1e95fdb61041becd3d60c7fea0e708250533e898..c3befb3f5dcdaded7b5031878595e1abe7d92e24 100644 (file)
@@ -1761,6 +1761,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;
        }