Skip to content

Commit 5c422f0

Browse files
Marek Vasutbroonie
authored andcommitted
regmap: Add missing map->bus check
The map->bus can be NULL here, add the missing NULL pointer check. Fixes: d77e745 ("regmap: Add bulk read/write callbacks into regmap_config") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Mark Brown <[email protected]> To: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent eedd8a8 commit 5c422f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/base/regmap/regmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
18391839
map->format.reg_bytes +
18401840
map->format.pad_bytes +
18411841
val_len);
1842-
else if (map->bus->gather_write)
1842+
else if (map->bus && map->bus->gather_write)
18431843
ret = map->bus->gather_write(map->bus_context, map->work_buf,
18441844
map->format.reg_bytes +
18451845
map->format.pad_bytes,

0 commit comments

Comments
 (0)