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

Commit 1d239e70 authored by Maya Erez's avatar Maya Erez
Browse files

usb: host: Verify sg before accessing it in qh_urb_transaction



Fix code quality issues found by the automatic checking tool.
Verify safe access to sg in qh_urb_transaction.

Change-Id: I6ce40e8548449aebd628c72bc2b9cda1b2861ba9
CRs-Fixed: 566927
Signed-off-by: default avatarDanny Segal <dsegal@codeaurora.org>
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent c5b954d0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -683,7 +683,7 @@ qh_urb_transaction (
		if ((maxpacket & (this_qtd_len + (maxpacket - 1))) == 0)
			token ^= QTD_TOGGLE;

		if (likely(this_sg_len <= 0)) {
		if (likely(sg && (this_sg_len <= 0))) {
			if (--i <= 0 || len <= 0)
				break;
			sg = sg_next(sg);