[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200116231745.430527440@linuxfoundation.org>
Date: Fri, 17 Jan 2020 00:15:20 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Jacopo Mondi <jacopo@...ndi.org>,
Janusz Krzysztofik <jmkrzyszt@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Marcel Partap <mpartap@....net>,
Merlijn Wajer <merlijn@...zup.org>,
Michael Scott <hashcode0f@...il.com>,
NeKit <nekit1000@...il.com>, Pavel Machek <pavel@....cz>,
Sebastian Reichel <sre@...nel.org>,
Tony Lindgren <tony@...mide.com>,
Kishon Vijay Abraham I <kishon@...com>
Subject: [PATCH 5.4 003/203] phy: mapphone-mdm6600: Fix uninitialized status value regression
From: Tony Lindgren <tony@...mide.com>
commit af5d44de571811a151510bfd1236407b7f551cd9 upstream.
Only the used bits get cleared with bitmap_zero() when we call
gpiod_get_array_value_cansleep(). We must mask only the bits we're
using for ddata->status as the other bits in the bitmap may not be
initialized.
And let's also drop useless debug code accidentally left over while
at it.
Fixes: b9762bebc633 ("gpiolib: Pass bitmaps, not integer arrays, to get/set array")
Cc: Jacopo Mondi <jacopo@...ndi.org>
Cc: Janusz Krzysztofik <jmkrzyszt@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>
Cc: Marcel Partap <mpartap@....net>
Cc: Merlijn Wajer <merlijn@...zup.org>
Cc: Michael Scott <hashcode0f@...il.com>
Cc: NeKit <nekit1000@...il.com>
Cc: Pavel Machek <pavel@....cz>
Cc: Sebastian Reichel <sre@...nel.org>
Signed-off-by: Tony Lindgren <tony@...mide.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@...com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/phy/motorola/phy-mapphone-mdm6600.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
+++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
@@ -200,7 +200,7 @@ static void phy_mdm6600_status(struct wo
struct phy_mdm6600 *ddata;
struct device *dev;
DECLARE_BITMAP(values, PHY_MDM6600_NR_STATUS_LINES);
- int error, i, val = 0;
+ int error;
ddata = container_of(work, struct phy_mdm6600, status_work.work);
dev = ddata->dev;
@@ -212,16 +212,11 @@ static void phy_mdm6600_status(struct wo
if (error)
return;
- for (i = 0; i < PHY_MDM6600_NR_STATUS_LINES; i++) {
- val |= test_bit(i, values) << i;
- dev_dbg(ddata->dev, "XXX %s: i: %i values[i]: %i val: %i\n",
- __func__, i, test_bit(i, values), val);
- }
- ddata->status = values[0];
+ ddata->status = values[0] & ((1 << PHY_MDM6600_NR_STATUS_LINES) - 1);
dev_info(dev, "modem status: %i %s\n",
ddata->status,
- phy_mdm6600_status_name[ddata->status & 7]);
+ phy_mdm6600_status_name[ddata->status]);
complete(&ddata->ack);
}
Powered by blists - more mailing lists