diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2016-02-25 18:05:09 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-02-25 16:54:11 -0800 |
commit | bf9deb29e2b3c5dbc97ce559325f4faa0bad5022 (patch) | |
tree | 3771414f6d8defb930ffdb62bdd81a3039d23ee3 /drivers/staging/greybus/light.c | |
parent | e915ce48bae606b79150a4d799a30037604a93ed (diff) |
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 <johan@hovoldconsulting.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/light.c')
-rw-r--r-- | drivers/staging/greybus/light.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |