提交 bf9deb29 编写于 作者: R Rui Miguel Silva 提交者: Greg Kroah-Hartman

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: NJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: NRui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@google.com>
上级 e915ce48
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册