Commit 5c422f0b authored by Marek Vasut's avatar Marek Vasut Committed by Mark Brown

regmap: Add missing map->bus check

The map->bus can be NULL here, add the missing NULL pointer check.

Fixes: d77e7456 ("regmap: Add bulk read/write callbacks into regmap_config")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mark Brown <broonie@kernel.org>
To: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20220509003035.225272-1-marex@denx.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent eedd8a85
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment