iio: adc: rockchip_saradc: fix crash cause by saradc

fix the crash caused by interrupt occurring before info->last_chan is ready

Change-Id: I6a57d49d5af6fb35708e009c33422ad936af0d3f
Signed-off-by: Simon Xue <xxm@rock-chips.com>
This commit is contained in:
Simon Xue
2025-02-10 11:24:39 +08:00
committed by Tao Huang
parent bb5e238d4f
commit e5ecfb7289

View File

@@ -229,6 +229,10 @@ static irqreturn_t rockchip_saradc_isr(int irq, void *dev_id)
unsigned long flags;
#endif
/* Nothing need to do if info->last_chan not ready */
if (!info->last_chan)
return IRQ_HANDLED;
/* Read value */
info->last_val = rockchip_saradc_read(info);
#ifndef CONFIG_ROCKCHIP_SARADC_TEST_CHN