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

Commit bf9deb29 authored by Rui Miguel Silva's avatar Rui Miguel Silva Committed by Greg Kroah-Hartman
Browse files

greybus: lights: remove unnecessary check



lights can never be NULL at that point since lights_count must be different than
zero, and we need only to validate the light_id.

Reported-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent e915ce48
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1178,7 +1178,7 @@ static int gb_lights_request_handler(struct gb_operation *op)
	payload = request->payload;
	light_id = payload->light_id;

	if (light_id >= glights->lights_count || !glights->lights ||
	if (light_id >= glights->lights_count ||
	    !glights->lights[light_id].ready) {
		dev_err(dev, "Event received for unconfigured light id: %d\n",
			light_id);