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

Commit 9fcf966d authored by Sudheer Papothi's avatar Sudheer Papothi
Browse files

ASoC: wsa883x: Fix size for register access



Fix size for soundwire slave register dump in debug mode.

Change-Id: I9d2e4a394943cdb0ba2e5ec5208c96b76b0a1292
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
parent 70561ef6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -234,9 +234,9 @@ static ssize_t swr_slave_reg_show(struct swr_device *pdev, char __user *ubuf,
		if (!is_swr_slave_reg_readable(i))
			continue;
		swr_read(pdev, pdev->dev_num, i, &reg_val, 1);
		len = snprintf(tmp_buf, 25, "0x%.3x: 0x%.2x\n", i,
		len = snprintf(tmp_buf, sizeof(tmp_buf), "0x%.3x: 0x%.2x\n", i,
			       (reg_val & 0xFF));
		if ((total + len) >= count - 1)
		if (((total + len) >= count - 1) || (len < 0))
			break;
		if (copy_to_user((ubuf + total), tmp_buf, len)) {
			pr_err("%s: fail to copy reg dump\n", __func__);