Skip to content

Commit e2fb2f8

Browse files
Zicheng Qujic23
authored andcommitted
iio: gts: Fix uninitialized symbol 'ret'
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: 38416c2 ("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>
1 parent 62dd96a commit e2fb2f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/iio/industrialio-gts-helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static int iio_gts_gain_cmp(const void *a, const void *b)
167167

168168
static int gain_to_scaletables(struct iio_gts *gts, int **gains, int **scales)
169169
{
170-
int ret, i, j, new_idx, time_idx;
170+
int i, j, new_idx, time_idx, ret = 0;
171171
int *all_gains;
172172
size_t gain_bytes;
173173

0 commit comments

Comments
 (0)