* [PATCH AUTOSEL 3.18 2/6] Input: matrix_keypad - use flush_delayed_work() [not found] <20190311195951.139741-1-sashal@kernel.org> @ 2019-03-11 19:59 ` Sasha Levin 2019-03-11 19:59 ` [PATCH AUTOSEL 3.18 6/6] Input: st-keyscan - fix potential zalloc NULL dereference Sasha Levin 1 sibling, 0 replies; 2+ messages in thread From: Sasha Levin @ 2019-03-11 19:59 UTC (permalink / raw) To: linux-kernel, stable; +Cc: Dmitry Torokhov, Sasha Levin, linux-input From: Dmitry Torokhov <dmitry.torokhov@gmail.com> [ Upstream commit a342083abe576db43594a32d458a61fa81f7cb32 ] We should be using flush_delayed_work() instead of flush_work() in matrix_keypad_stop() to ensure that we are not missing work that is scheduled but not yet put in the workqueue (i.e. its delay timer has not expired yet). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/input/keyboard/matrix_keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 176bdd140769..a1b9753e0616 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -220,7 +220,7 @@ static void matrix_keypad_stop(struct input_dev *dev) keypad->stopped = true; spin_unlock_irq(&keypad->lock); - flush_work(&keypad->work.work); + flush_delayed_work(&keypad->work); /* * matrix_keypad_scan() will leave IRQs enabled; * we should disable them now. -- 2.19.1 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH AUTOSEL 3.18 6/6] Input: st-keyscan - fix potential zalloc NULL dereference [not found] <20190311195951.139741-1-sashal@kernel.org> 2019-03-11 19:59 ` [PATCH AUTOSEL 3.18 2/6] Input: matrix_keypad - use flush_delayed_work() Sasha Levin @ 2019-03-11 19:59 ` Sasha Levin 1 sibling, 0 replies; 2+ messages in thread From: Sasha Levin @ 2019-03-11 19:59 UTC (permalink / raw) To: linux-kernel, stable Cc: Gabriel Fernandez, Dmitry Torokhov, Sasha Levin, linux-input From: Gabriel Fernandez <gabriel.fernandez@st.com> [ Upstream commit 2439d37e1bf8a34d437573c086572abe0f3f1b15 ] This patch fixes the following static checker warning: drivers/input/keyboard/st-keyscan.c:156 keyscan_probe() error: potential zalloc NULL dereference: 'keypad_data->input_dev' Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/input/keyboard/st-keyscan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c index de7be4f03d91..ebf9f643d910 100644 --- a/drivers/input/keyboard/st-keyscan.c +++ b/drivers/input/keyboard/st-keyscan.c @@ -153,6 +153,8 @@ static int keyscan_probe(struct platform_device *pdev) input_dev->id.bustype = BUS_HOST; + keypad_data->input_dev = input_dev; + error = keypad_matrix_key_parse_dt(keypad_data); if (error) return error; @@ -168,8 +170,6 @@ static int keyscan_probe(struct platform_device *pdev) input_set_drvdata(input_dev, keypad_data); - keypad_data->input_dev = input_dev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); keypad_data->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(keypad_data->base)) -- 2.19.1 ^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-11 19:59 UTC | newest] Thread overview: 2+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20190311195951.139741-1-sashal@kernel.org> 2019-03-11 19:59 ` [PATCH AUTOSEL 3.18 2/6] Input: matrix_keypad - use flush_delayed_work() Sasha Levin 2019-03-11 19:59 ` [PATCH AUTOSEL 3.18 6/6] Input: st-keyscan - fix potential zalloc NULL dereference Sasha Levin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).