Commit 3ad2b06f authored by Flavio Ceolin's avatar Flavio Ceolin Committed by Anas Nashif
Browse files

device: Fix device from handle function



This function was returning NULL for the last handle because of a
wrong comparison.

Signed-off-by: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
parent 8580f63a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -431,7 +431,7 @@ device_from_handle(device_handle_t dev_handle)
	const struct device *dev = NULL;
	size_t numdev = __device_end - __device_start;

	if ((dev_handle > 0) && ((size_t)dev_handle < numdev)) {
	if ((dev_handle > 0) && ((size_t)dev_handle <= numdev)) {
		dev = &__device_start[dev_handle - 1];
	}