Skip to content

Commit a98de6d

Browse files
committed
iio: frequency: adf4030: fix possible uninitialized 'ret'
In adf4030_chan_dir_set(), every time 'initial' is false, 'ret' was being used uninitialized because we're ignoring the return value from regmap_update_bits(). Make sure we don't! Fixes: 54bbd40 ("iio: frequency: support the adf4030 Synchronizer") Signed-off-by: Nuno Sá <[email protected]>
1 parent bcf17bb commit a98de6d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/iio/frequency/adf4030.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,13 @@ static int adf4030_chan_dir_set(const struct adf4030_state *st,
334334

335335
/* EN_DRIVE */
336336
if (chan->num > 7)
337-
regmap_update_bits(st->regmap, ADF4030_REG(0x13),
338-
BIT(chan->num - 8),
339-
chan->channel_output_en ? BIT(chan->num - 8) : 0);
337+
ret = regmap_update_bits(st->regmap, ADF4030_REG(0x13),
338+
BIT(chan->num - 8),
339+
chan->channel_output_en ? BIT(chan->num - 8) : 0);
340340
else
341-
regmap_update_bits(st->regmap, ADF4030_REG(0x12),
342-
BIT(chan->num),
343-
chan->channel_output_en ? BIT(chan->num) : 0);
341+
ret = regmap_update_bits(st->regmap, ADF4030_REG(0x12),
342+
BIT(chan->num),
343+
chan->channel_output_en ? BIT(chan->num) : 0);
344344
if (ret)
345345
return ret;
346346

0 commit comments

Comments
 (0)