Commit 52628a85 authored by Dan Carpenter's avatar Dan Carpenter Committed by Rafael J. Wysocki
Browse files

thermal: int340x: delete bogus length check



This check has a signedness bug and does not work.  If "length" is
larger than "PAGE_SIZE" then "PAGE_SIZE - length" is not negative
but instead it is a large unsigned value.  Fortunately, Takashi Iwai
changed this code to use scnprint() instead of snprintf() so now
"length" is never larger than "PAGE_SIZE - 1" and the check can be
removed.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9e1ff307
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -129,7 +129,6 @@ static ssize_t available_uuids_show(struct device *dev,


	for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {
	for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {
		if (priv->uuid_bitmap & (1 << i))
		if (priv->uuid_bitmap & (1 << i))
			if (PAGE_SIZE - length > 0)
			length += scnprintf(&buf[length],
			length += scnprintf(&buf[length],
					    PAGE_SIZE - length,
					    PAGE_SIZE - length,
					    "%s\n",
					    "%s\n",