Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751975AbbKIXQP (ORCPT ); Mon, 9 Nov 2015 18:16:15 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36442 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751058AbbKIXQN (ORCPT ); Mon, 9 Nov 2015 18:16:13 -0500 Date: Mon, 9 Nov 2015 15:16:10 -0800 From: Dmitry Torokhov To: Andrew Duggan Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires , Linus Walleij , Benjamin Tissoires , Christopher Heiny , Stephen Chandler Paul Subject: Re: [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound Message-ID: <20151109231610.GF9155@dtor-ws> References: <1446766645-30350-1-git-send-email-aduggan@synaptics.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1446766645-30350-1-git-send-email-aduggan@synaptics.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1370 Lines: 41 On Thu, Nov 05, 2015 at 03:37:25PM -0800, Andrew Duggan wrote: > From: Benjamin Tissoires > > If the device has been registered but is not populated, we should not > process any incoming interrupt. > Make sure the pointers we are following are valid. Why are the interrupts enabled when device is not ready? > > Signed-off-by: Benjamin Tissoires > Tested-by: Andrew Duggan > --- > drivers/input/rmi4/rmi_driver.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c > index 2fdc7e8..fe5f2f9 100644 > --- a/drivers/input/rmi4/rmi_driver.c > +++ b/drivers/input/rmi4/rmi_driver.c > @@ -279,6 +279,9 @@ int rmi_process_interrupt_requests(struct rmi_device *rmi_dev) > struct rmi_function *entry; > int error; > > + if (!data || !data->f01_container || !data->irq_status) > + return 0; > + > error = rmi_read_block(rmi_dev, > data->f01_container->fd.data_base_addr + 1, > data->irq_status, data->num_of_irq_regs); > -- > 2.1.4 > -- Dmitry -- 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/