[PATCH] uwb: Shouldn't event_size be ssize_t?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



downstream in function hwarc_filter_event_WUSB_0100() occurs:

event_size = hwarc_get_event_size(rc, rceb, core_size, offset, buf_size);
if (event_size < 0)
	goto out;

This won't work since event_size is unsigned. Shouldn't event_size be ssize_t?
hwarc_get_event_size() also returns ssize_t.

This patch wasn't tested in any way.
------------------------------>8-------------8<---------------------------------
make event_size signed so an error return of hwarc_get_event_size() can be
noticed

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
index 559f878..9052bcb 100644
--- a/drivers/uwb/hwa-rc.c
+++ b/drivers/uwb/hwa-rc.c
@@ -501,7 +501,7 @@ int hwarc_filter_event_WUSB_0100(struct uwb_rc *rc, struct uwb_rceb **header,
 	int result = -ENOANO;
 	struct uwb_rceb *rceb = *header;
 	int event = le16_to_cpu(rceb->wEvent);
-	size_t event_size;
+	ssize_t event_size;
 	size_t core_size, offset;
 
 	if (rceb->bEventType != UWB_RC_CET_GENERAL)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux