media: dib7000p: Fix potential division by zero
authorDaniil Dulov <d.dulov@aladdin.ru>
Fri, 24 Mar 2023 13:38:32 +0000 (06:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:50 +0000 (09:42 +0200)
commit323ee5fc980bf4ef87f047ee6624dc915d221682
tree118ee2953f93f2cf0f930ba8bdf06e2339ef0fa4
parent90e0ea8e9b26613147922132467a36c0d5d7659f
media: dib7000p: Fix potential division by zero

[ Upstream commit a1db7b2c5533fc67e2681eb5efc921a67bc7d5b8 ]

Variable loopdiv can be assigned 0, then it is used as a denominator,
without checking it for 0.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 713d54a8bd81 ("[media] DiB7090: add support for the dib7090 based")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: (bw != NULL) -> bw]
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/dvb-frontends/dib7000p.c