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

Commit f179d9bf authored by ChandanaKishori Chiluveru's avatar ChandanaKishori Chiluveru
Browse files

USB: f_mass_storage: Increase the IN endpoint buffer allocation



Some UDC may require allocation of some extra bytes for
TX buffer due to hardware requirement. Add necessary
changes for the same.

Change-Id: I503fe186f4e75e35c3ca7193805f28c62350dd25
Signed-off-by: default avatarSujeet Kumar <ksujeet@codeaurora.org>
Signed-off-by: default avatarChandanaKishori Chiluveru <cchilu@codeaurora.org>
parent a1189634
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2893,6 +2893,10 @@ int fsg_common_set_num_buffers(struct fsg_common *common, unsigned int n)
{
	struct fsg_buffhd *bh, *buffhds;
	int i, rc;
	size_t extra_buf_alloc = 0;

	if (common->gadget)
		extra_buf_alloc = common->gadget->extra_buf_alloc;

	rc = fsg_num_buffers_validate(n);
	if (rc != 0)
@@ -2910,7 +2914,8 @@ int fsg_common_set_num_buffers(struct fsg_common *common, unsigned int n)
		bh->next = bh + 1;
		++bh;
buffhds_first_it:
		bh->buf = kmalloc(FSG_BUFLEN, GFP_KERNEL);
		bh->buf = kmalloc(FSG_BUFLEN + extra_buf_alloc,
				GFP_KERNEL);
		if (unlikely(!bh->buf))
			goto error_release;
	} while (--i);