]> Git Repo - J-linux.git/commitdiff
Input: synaptics-rmi4 - fix crash when DPM query is not supported
authorDmitry Torokhov <[email protected]>
Tue, 3 Sep 2024 20:59:06 +0000 (13:59 -0700)
committerDmitry Torokhov <[email protected]>
Tue, 3 Sep 2024 22:01:11 +0000 (15:01 -0700)
Stop clobbering "item" variable when checking if the device supports
querying DPM values because its original value is still needed in
case when we need to fall back to the old way of figuring sensor size.

Reported-by: Richard Acayan <[email protected]>
Tested-by: Richard Acayan <[email protected]>
Fixes: 14d650fcb7fb ("Input: synaptics-rmi4 - add support for querying DPM value (F12)")
Link: https://lore.kernel.org/r/ZtdQW7nqAOEJDNBN@radian
Signed-off-by: Dmitry Torokhov <[email protected]>
drivers/input/rmi4/rmi_f12.c

index fc2cc8e2b0ba95faeb294433880491fd58241a41..8246fe77114bbd8b795ba35d5a37ede8727fc7cb 100644 (file)
@@ -129,9 +129,8 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
         * Use the Query DPM feature when the resolution query register
         * exists.
         */
-       item = rmi_get_register_desc_item(&f12->query_reg_desc,
-                                         RMI_F12_QUERY_RESOLUTION);
-       if (item) {
+       if (rmi_get_register_desc_item(&f12->query_reg_desc,
+                                      RMI_F12_QUERY_RESOLUTION)) {
                offset = rmi_register_desc_calc_reg_offset(&f12->query_reg_desc,
                                                RMI_F12_QUERY_RESOLUTION);
                query_dpm_addr = fn->fd.query_base_addr + offset;
This page took 0.047995 seconds and 4 git commands to generate.