Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753969AbbGBRus (ORCPT ); Thu, 2 Jul 2015 13:50:48 -0400 Received: from [192.147.44.131] ([192.147.44.131]:53732 "EHLO us-mx1.synaptics.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752928AbbGBRu3 (ORCPT ); Thu, 2 Jul 2015 13:50:29 -0400 X-PGP-Universal: processed; by securemail.synaptics.com on Thu, 02 Jul 2015 11:36:44 -0700 Message-ID: <559579CF.9030407@synaptics.com> Date: Thu, 2 Jul 2015 10:50:07 -0700 From: Andrew Duggan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Benjamin Tissoires , Dmitry Torokhov , Christopher Heiny , Allie Xiong CC: Stephen Chandler Paul , , , , Vincent Huang Subject: Re: [PATCH 04/11] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound References: <1435087050-11444-1-git-send-email-benjamin.tissoires@redhat.com> <1435087050-11444-5-git-send-email-benjamin.tissoires@redhat.com> In-Reply-To: <1435087050-11444-5-git-send-email-benjamin.tissoires@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.4.10.145] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1216 Lines: 33 On 06/23/2015 12:17 PM, Benjamin Tissoires wrote: > 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. > > Signed-off-by: Benjamin Tissoires > --- Reviewed-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); -- 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/