Message ID | 20250402-synaptics-rmi4-v4-4-1bb95959e564@ixit.cz (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Input: synaptics-rmi4 - add quirks for third party touchscreen controllers | expand |
diff --git a/drivers/input/rmi4/rmi_f55.c b/drivers/input/rmi4/rmi_f55.c index 488adaca4dd00482cd1106d813b32871092c83a0..776c915b82e72b8a6eb5ec701cce9059c87089c4 100644 --- a/drivers/input/rmi4/rmi_f55.c +++ b/drivers/input/rmi4/rmi_f55.c @@ -52,6 +52,11 @@ static int rmi_f55_detect(struct rmi_function *fn) f55->num_rx_electrodes = f55->qry[F55_NUM_RX_OFFSET]; f55->num_tx_electrodes = f55->qry[F55_NUM_TX_OFFSET]; + if (!f55->num_rx_electrodes || !f55->num_tx_electrodes) { + dev_err(&fn->dev, "%s: F55 query returned no electrodes, giving up\n", + __func__); + return -EINVAL; + } f55->cfg_num_rx_electrodes = f55->num_rx_electrodes; f55->cfg_num_tx_electrodes = f55->num_rx_electrodes;