Commit fb5cc65
Input: adp5589-keys - fix NULL pointer dereference
We register a devm action to call adp5589_clear_config() and then pass
the i2c client as argument so that we can call i2c_get_clientdata() in
order to get our device object. However, i2c_set_clientdata() is only
being set at the end of the probe function which means that we'll get a
NULL pointer dereference in case the probe function fails early.
Fixes: 30df385 ("Input: adp5589-keys - use devm_add_action_or_reset() for register clear")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20241001-b4-dev-adp5589-fw-conversion-v1-1-fca0149dfc47@analog.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>1 parent a3f9a74 commit fb5cc65
1 file changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
939 | | - | |
940 | | - | |
| 939 | + | |
941 | 940 | | |
942 | | - | |
| 941 | + | |
943 | 942 | | |
944 | 943 | | |
945 | 944 | | |
| |||
983 | 982 | | |
984 | 983 | | |
985 | 984 | | |
986 | | - | |
| 985 | + | |
987 | 986 | | |
988 | 987 | | |
989 | 988 | | |
| |||
1010 | 1009 | | |
1011 | 1010 | | |
1012 | 1011 | | |
1013 | | - | |
1014 | | - | |
1015 | 1012 | | |
1016 | 1013 | | |
1017 | 1014 | | |
| |||
0 commit comments