]> Git Repo - J-linux.git/commitdiff
regmap: Add missing map->bus check
authorMarek Vasut <[email protected]>
Mon, 9 May 2022 00:30:35 +0000 (02:30 +0200)
committerMark Brown <[email protected]>
Mon, 9 May 2022 11:48:45 +0000 (12:48 +0100)
The map->bus can be NULL here, add the missing NULL pointer check.

Fixes: d77e745613680 ("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]>
drivers/base/regmap/regmap.c

index 879a87a6461be84e5d1800001d683bac81cfb908..2221d98638317a7b1003c5befed3b860f4f94847 100644 (file)
@@ -1839,7 +1839,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
                                 map->format.reg_bytes +
                                 map->format.pad_bytes +
                                 val_len);
-       else if (map->bus->gather_write)
+       else if (map->bus && map->bus->gather_write)
                ret = map->bus->gather_write(map->bus_context, map->work_buf,
                                             map->format.reg_bytes +
                                             map->format.pad_bytes,
This page took 0.055575 seconds and 4 git commands to generate.