From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6615BC282C2 for ; Wed, 13 Feb 2019 18:48:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D689222D1 for ; Wed, 13 Feb 2019 18:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550083695; bh=KXuUEyVQFnjWasnvvX1EPN3UHTg/MLWhKBpYZN++uck=; h=Subject:To:From:Date:List-ID:From; b=HZmfWdZzOF2Il/bXkRERwgmI8UW1OJKNCHgfy7hUOEaTql6Y84QHtKeMsyRIcSoM9 47LePFeyMTCVaHMR2GipuH80DC6WSis10etk/OLcXEP8Uy1LLDn5u5x3rJ4WGvTzPa Ny++ovbX4HuFXs6UW/M1VEbXwvYB/q2fSII5h6nM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731848AbfBMSsO (ORCPT ); Wed, 13 Feb 2019 13:48:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:46512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730017AbfBMSsN (ORCPT ); Wed, 13 Feb 2019 13:48:13 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7EDFD20811; Wed, 13 Feb 2019 18:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550083693; bh=KXuUEyVQFnjWasnvvX1EPN3UHTg/MLWhKBpYZN++uck=; h=Subject:To:From:Date:From; b=gzkn0cyO5z7RNfAr6AxfH3o85UEkGceWPrriVnkBkyxC1LWj1mu24PX/IbN/TlvTg mvTzBeGTxZXfPb6Nnc7LnaotROyJJWxIx9SUxK6Z9EI8pVRFOeCRfB6POGF3cLOp+r QEIF7IazkYYX/iGn94Jl/8MJCZvoL/OiHpY0X3DQ= Subject: patch "iio: adc: exynos-adc: Fix NULL pointer exception on unbind" added to staging-next To: krzk@kernel.org, Jonathan.Cameron@huawei.com, stable@vger.kernel.org From: Date: Wed, 13 Feb 2019 19:42:09 +0100 Message-ID: <1550083329123117@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled iio: adc: exynos-adc: Fix NULL pointer exception on unbind to my staging git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git in the staging-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. >From 2ea8bab4dd2a9014e723b28091831fa850b82d83 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 9 Feb 2019 00:39:27 +0100 Subject: iio: adc: exynos-adc: Fix NULL pointer exception on unbind Fix NULL pointer exception on device unbind when device tree does not contain "has-touchscreen" property. In such case the input device is not registered so it should not be unregistered. $ echo "12d10000.adc" > /sys/bus/platform/drivers/exynos-adc/unbind Unable to handle kernel NULL pointer dereference at virtual address 00000474 ... (input_unregister_device) from [] (exynos_adc_remove+0x20/0x80) (exynos_adc_remove) from [] (platform_drv_remove+0x20/0x40) (platform_drv_remove) from [] (device_release_driver_internal+0xdc/0x1ac) (device_release_driver_internal) from [] (unbind_store+0x60/0xd4) (unbind_store) from [] (kernfs_fop_write+0x100/0x1e0) (kernfs_fop_write) from [] (__vfs_write+0x2c/0x17c) (__vfs_write) from [] (vfs_write+0xa4/0x184) (vfs_write) from [] (ksys_write+0x4c/0xac) (ksys_write) from [] (ret_fast_syscall+0x0/0x28) Fixes: 2bb8ad9b44c5 ("iio: exynos-adc: add experimental touchscreen support") Cc: Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jonathan Cameron --- drivers/iio/adc/exynos_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c index fa2d2b5767f3..41da522fc673 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -929,7 +929,7 @@ static int exynos_adc_remove(struct platform_device *pdev) struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct exynos_adc *info = iio_priv(indio_dev); - if (IS_REACHABLE(CONFIG_INPUT)) { + if (IS_REACHABLE(CONFIG_INPUT) && info->input) { free_irq(info->tsirq, info); input_unregister_device(info->input); } -- 2.20.1