]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: ccs: Avoid possible division by zero
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 24 Nov 2025 22:24:48 +0000 (00:24 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 14 Jan 2026 22:33:02 +0000 (23:33 +0100)
commit679f0b7b6a409750a25754c8833e268e5fdde742
treee1894d772dc3b25fb67a79e0d6f67ec6edadec9a
parent37a5b80a94cc6ca3b6a5c2999a6ad008ca2e6277
media: ccs: Avoid possible division by zero

Calculating maximum M for scaler configuration involves dividing by
MIN_X_OUTPUT_SIZE limit register's value. Albeit the value is presumably
non-zero, the driver was missing the check it in fact was. Fix this.

Reported-by: Josh Poimboeuf <jpoimboe@kernel.org>
Closes: https://lore.kernel.org/all/ahukd6b3wonye3zgtptvwzvrxldcruazs2exfvll6etjhmcxyj@vq3eh6pd375b/
Fixes: ccfc97bdb5ae ("[media] smiapp: Add driver")
Cc: stable@vger.kernel.org # for 5.15 and later
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/ccs/ccs-core.c