]> git.hungrycats.org Git - linux/commit
iio: gts: Fix uninitialized symbol 'ret'
authorZicheng Qu <quzicheng@huawei.com>
Thu, 31 Oct 2024 01:45:05 +0000 (01:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:54:20 +0000 (13:54 +0100)
commit4f32048b05f7ff5c4855a35778c21b2ed7fbc558
treea65f297700f13948269ab02c5662aa336137d912
parent39373f6f89f52770a5405d30dddd08a27d097872
iio: gts: Fix uninitialized symbol 'ret'

commit e2fb2f89faf87b681038475d093214f4cbe12ebb upstream.

Initialize the variable ret at the time of declaration to prevent it from
being returned without a defined value. Fixes smatch warning:
drivers/iio/industrialio-gts-helper.c:256 gain_to_scaletables() error:
uninitialized symbol 'ret'.

Cc: stable@vger.kernel.org # v6.6+
Fixes: 38416c28e168 ("iio: light: Add gain-time-scale helpers")
Signed-off-by: Zicheng Qu <quzicheng@huawei.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://patch.msgid.link/20241031014505.2313035-1-quzicheng@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/industrialio-gts-helper.c