The condition being tested for that BUG() invocation is often
recoverable, so replace BUG() with a WARN_ON() and return EINVAL.
This prevents specific user space call sequences crashing the kernel,
which should never happen.
The callers of fimc_is_itf_s_param() function will be updated in
subsequent patches if necessary, to prevent any further possible
crashes.
Change-Id: I90a08278baa0cee85a4a69fa1b278e28e5c6764a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
BUG_ON(!device);
if (frame) {
- if (!test_bit(FIMC_IS_ISHCAIN_START, &device->state)) {
+ if (WARN_ON(!test_bit(FIMC_IS_ISHCAIN_START, &device->state))) {
merr("s_param failed, device already is stopped", device);
- BUG();
+ return -EINVAL;
}
dst_base = &device->is_region->parameter;