From: Rui Miguel Silva Date: Thu, 25 Feb 2016 18:05:09 +0000 (+0000) Subject: greybus: lights: remove unnecessary check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf9deb29e2b3c5dbc97ce559325f4faa0bad5022;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Johan Hovold Signed-off-by: Rui Miguel Silva Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 17877f7e2ee4..47d4ac4533bc 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -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);