Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753198AbbK3LY7 (ORCPT ); Mon, 30 Nov 2015 06:24:59 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:59499 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbbK3LY5 (ORCPT ); Mon, 30 Nov 2015 06:24:57 -0500 From: Arnd Bergmann To: Lee Jones Cc: Michael Hennerich , Jingoo Han , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] backlight: adp8860: fix another uninitialized variable use Date: Mon, 30 Nov 2015 12:24:23 +0100 Message-ID: <3284846.T0rzz6n1As@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:2qTx6FxZ4BB5+ozma+eAMq+4iLOIhlF/XvssWMoxmURoC5B/n1F ZNlON0EcIhAeYpt8LeSEETrlDCqzG1oS6kalwjdge7gTk8XFKGyYD6piWWHtaDuUY3Z9TfT pEPjsjz2d2nxCTgPJ79mC3MEavnQN8Fk9x5H90E0xyVCYEnhNiIhfjJEb0uTUM7w1zIDO2q ZMtPgPIFKnNX+Q0+VypjQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:UakRoK4NzFg=:Jj5VI9xdsBXxKe1GdD7dY3 Nl5sgjlUVd836vOD/cgQAJR+XNibRuJciWwT3wq4LE3lnzlBib4tskM09kXAuWRZWGPklAo2R ONCjuwxgbAFpfEzsftqEzpsBgqBQ/6WaUiLZb2oODmsd3GUDtmOTpAKQjjAkhtQTl5bIJF2wE azmYRt0tRkwKpqaq7JYifBcbIJ1uYenqHLjyOe04GFhwDWlOvEMzqeAxJwjVmUjklCdwh2fBj bBEwXAbmVYWsAZptQUeEO8dZCExNnc1c9qkHTwbXAQ2PW5rtpARjj2PN1f0P5+LLSKj82QdX3 UxSv3RSap5U5YySLWS3/+0c85rYMjSpGjsx+TSrEVkoJmJtTpzp3jiGlib/HqJDRKHpMirz9B FaQOUMdiLmolSWxyA8M/5lvug68ulRtPzv4EIz0zsiiqyrp38+qex5GB5VGqkvnPTsFs9xAdR fL55D/xeHBJuhrLVHGhICUMMLnGucXszJ1kbPvuM06oeJiKuz7FcH0jYr/uls9i0KzIT6ZjRQ up+kDuHAcZlVv1WUIJkkrUpr9yzgmF+7MINuHDOArxtTYjhjsdZ5D+fORSY6Q/2aU8MDK+s8F MRPp3PQt47QWRVreymPTp4/NnRQ+vpzwGYY4z+9pnoFV3lIcPpSyOUd9b8xy9jSvYFEncDjpp 2BwW35gQFECwuQxnDCHUkWF9ne0DL3pHifk9knmZ9fLp8mY5RAYBKcCUUL11TGAz4YyzZHpWm HWbxH6xLy06UHUOt Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1704 Lines: 43 A recent patch I did fixed two potential uses of uninitialized variables in the adp8870 and adp8860 drivers. Unfortunately, I missed another one: drivers/video/backlight/adp8860_bl.c: In function 'adp8860_bl_ambient_light_level_show': drivers/video/backlight/adp8860_bl.c:570:11: warning: 'reg_val' may be used uninitialized in this function This does the same change as before in one additional function, and also changes the check for the return value in a way that avoids another false positive warning with a similar message. Signed-off-by: Arnd Bergmann Fixes: 6be3a5a9cd91 ("backlight: adp88x0: Fix uninitialized variable use") --- Sorry for missing this third hunk the first time around. diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c index f0d4c0324580..510e559c060e 100644 --- a/drivers/video/backlight/adp8860_bl.c +++ b/drivers/video/backlight/adp8860_bl.c @@ -566,11 +566,13 @@ static ssize_t adp8860_bl_ambient_light_level_show(struct device *dev, mutex_lock(&data->lock); error = adp8860_read(data->client, ADP8860_PH1LEVL, ®_val); - ret_val = reg_val; - error |= adp8860_read(data->client, ADP8860_PH1LEVH, ®_val); + if (!error) { + ret_val = reg_val; + error = adp8860_read(data->client, ADP8860_PH1LEVH, ®_val); + } mutex_unlock(&data->lock); - if (error < 0) + if (error) return error; /* Return 13-bit conversion value for the first light sensor */ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/