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

Commit 5287bf72 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

USB: cyberjack: fix buggy integer overflow test



"old_rdtodo" and "size" are short type.  They are type promoted to int
and the condition is never true.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5a3e2055
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -279,7 +279,7 @@ static void cyberjack_read_int_callback(struct urb *urb)

		old_rdtodo = priv->rdtodo;

		if (old_rdtodo + size < old_rdtodo) {
		if (old_rdtodo > SHRT_MAX - size) {
			dev_dbg(dev, "To many bulk_in urbs to do.\n");
			spin_unlock(&priv->lock);
			goto resubmit;