Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6179aab authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: soundwire: add null check before pointer dereference."

parents 6bbaf84d 7cbf41a2
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -28,11 +28,16 @@ static int regmap_swr_gather_write(void *context,
	struct device *dev = context;
	struct swr_device *swr = to_swr_device(dev);
	struct regmap *map = dev_get_regmap(dev, NULL);
	size_t addr_bytes = map->format.reg_bytes;
	size_t addr_bytes;
	size_t val_bytes;
	int i, ret = 0;
	u16 reg_addr = 0;

	if (map == NULL) {
		dev_err(dev, "%s: regmap is NULL\n", __func__);
		return -EINVAL;
	}
	addr_bytes = map->format.reg_bytes;
	if (swr == NULL) {
		dev_err(dev, "%s: swr device is NULL\n", __func__);
		return -EINVAL;
@@ -154,10 +159,15 @@ static int regmap_swr_read(void *context,
	struct device *dev = context;
	struct swr_device *swr = to_swr_device(dev);
	struct regmap *map = dev_get_regmap(dev, NULL);
	size_t addr_bytes = map->format.reg_bytes;
	size_t addr_bytes;
	int ret = 0;
	u16 reg_addr = 0;

	if (map == NULL) {
		dev_err(dev, "%s: regmap is NULL\n", __func__);
		return -EINVAL;
	}
	addr_bytes = map->format.reg_bytes;
	if (swr == NULL) {
		dev_err(dev, "%s: swr is NULL\n", __func__);
		return -EINVAL;