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

Commit f005ce77 authored by Karthikeyan Ramasubramanian's avatar Karthikeyan Ramasubramanian
Browse files

slimbus: Check the input value for valid use-case



The number of messages to be transferred in a message list is not checked
for the valid use-case scenario.

Check the number of messages for the valid use-case scenario. Also ensure
that the return value is initialized properly.

CRs-Fixed: 2002163
Change-Id: Ic52a2bf83e9423594f3b0307d2428a0fe26cb716
Signed-off-by: default avatarKarthikeyan Ramasubramanian <kramasub@codeaurora.org>
parent 26182ced
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1170,9 +1170,9 @@ int slim_bulk_msg_write(struct slim_device *sb, u8 mt, u8 mc,
			struct slim_val_inf msgs[], int n,
			int (*comp_cb)(void *ctx, int err), void *ctx)
{
	int i, ret;
	int i, ret = 0;

	if (!sb || !sb->ctrl || !msgs)
	if (!sb || !sb->ctrl || !msgs || n <= 0)
		return -EINVAL;
	if (!sb->ctrl->xfer_bulk_wr) {
		pr_warn("controller does not support bulk WR, serializing");