summaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/utils.py
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2025-04-23 11:21:18 +0300
committerWolfram Sang <wsa+renesas@sang-engineering.com>2025-05-02 16:39:54 +0200
commit20d5620e9b290aba2fa891b2ef2d4a695fdb2f57 (patch)
treebbe39c3dbc03f038a7cef12f2f912d4c6f95d3ef /scripts/gdb/linux/utils.py
parent04668774f67f56df311d8ebe919b704ccd219ba3 (diff)
i2c: atr: Fix end of loop test in i2c_atr_find_mapping_by_addr()
When the list_for_each_entry_reverse() exits without hitting a break then the list cursor points to invalid memory. So this check for if (c2a->fixed) is checking bogus memory. Fix it by using a "found" variable to track if we found what we were looking for or not. The list head (i2c_atr_chan.alias_pairs) is not a full entry, it's just a struct list_head. When the for loop runs to completion, c2a doesn't point to a struct i2c_atr_alias_pair, so you can't access c2a->fixed. Fixes: c3f55241882b ("i2c: Support dynamic address translation") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Romain Gantois <romain.gantois@bootlin.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions