Skip to content

Commit

Permalink
iio: adc: cf_axi_adc_core: Fix NULL pointer dereference in axiadc_rea…
Browse files Browse the repository at this point in the history
…d_raw

Make sure extend_name exist before accessing it.

Fixes: dced6c9( "iio: adc: cf_axi_adc_core: Support for 64-bit")

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
  • Loading branch information
mhennerich committed Feb 21, 2022
1 parent 8e59ec4 commit 12a4e47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/adc/cf_axi_adc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ static int axiadc_read_raw(struct iio_dev *indio_dev,
llval = llval >> 16;
}

if (!strcmp(chan->extend_name, "user_logic")) {
if (chan->extend_name && !strcmp(chan->extend_name, "user_logic")) {
tmp = axiadc_read(st,
ADI_REG_CHAN_USR_CNTRL_2(channel));

Expand Down

0 comments on commit 12a4e47

Please sign in to comment.