summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorIsaac Adjei <code@isaacadjei.me>2026-11-05 08:16:51 +0000
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-11-06 10:43:16 +0100
commitcfbd01eddaf5bfdd4f53560013fe830571a186e9 (patch)
tree7efc240848eea6daade505c56ce835282ff04d45 /rust
parent7e899fe007d2ffc753e6aa5bc8f2ae0a802b9e07 (diff)
gpio: mpfs: reject unsupported interrupt types
The switch statement in mpfs_gpio_irq_set_type() does not handle unsupported interrupt types. For example, IRQ_TYPE_NONE is not listed. When an unsupported type is passed, interrupt_type remains uninitialised. Its undefined value is then written to the GPIO control register. The function still returns 0, making the caller believe the operation succeeded. Add a default case to return -EINVAL for unsupported interrupt types. Smatch reported the following warning: drivers/gpio/gpio-mpfs.c:144 mpfs_gpio_irq_set_type() error: uninitialized symbol 'interrupt_type'. I built the driver with W=1 and got no warnings. I also reran Smatch and confirmed that the warning was resolved. This is compile-tested only. I do not have access to PolarFire SoC hardware for runtime testing. Fixes: e57b53f0f36a ("gpio: mpfs: Add interrupt support") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/r/202411080149.bOpayvf6-lkp@intel.com/ Signed-off-by: Isaac Adjei <code@isaacadjei.me> Link: https://patch.msgid.link/20261105-gpio-mpfs-irq-type-v1-1-cbb2b0b2a807@isaacadjei.me Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'rust')
0 files changed, 0 insertions, 0 deletions