Uninitialized Variable Use in drivers/iio/adc/stm32-dfsdm-adc.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All:
Inside function stm32_dfsdm_irq(), the variable "status", "int_en"
could be uninitialized if the regmap_read() fails and returns an error
code.  However, they are directly used in the later context to decide
the control flow, which is potentially unsafe. However,
stm32_dfsdm_irq() returns the type irqreturn_t and I could not return
the error code directly. Could you please advise me here?

The related code:

static irqreturn_t stm32_dfsdm_irq(int irq, void *arg) {
    unsigned int status, int_en;

    regmap_read(regmap, DFSDM_ISR(adc->fl_id), &status);
    regmap_read(regmap, DFSDM_CR2(adc->fl_id), &int_en);

    if (status & DFSDM_ISR_REOCF_MASK) {}
    if (status & DFSDM_ISR_ROVRF_MASK) {}
}


-- 
Kind Regards,

Yizhuo Zhai

Computer Science, Graduate Student
University of California, Riverside



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux