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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=unavailable 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 5FBD9C282C4 for ; Sat, 9 Feb 2019 16:47:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B44921929 for ; Sat, 9 Feb 2019 16:47:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h6eitoZG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="B9FUTGyP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B44921929 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zg3sleHQsP29pNtTOu93aOLon0j4+2ohEG2AekYZHSE=; b=h6eitoZGgRoa5Y WRTVcckhnD/FVnwhRgIy1O090/e/1ACm71pf2rQWqUWb7uf+0IuqZ1Vx8aZAwKYlYr/cErvjNoQrh VyQbCCEoKex4NAdpEFzYACl3Ayb0cCBjtqAg8AnpNftZpbmZBpKSwFCoWitP4b7pfPT7318AmLbfh 9mZvzKnTrJlGui1SoZHkMjmof781tSxdkWLV6E1mG29h8XEMGzpXh+IVLSCfqqMBhCAbioOJ5WxX9 G/aUFHDcArOhL8cVPgf6eagBh+akSMH/r8iNlLKC391kGxHbaMiT7th26qLEQKiLyRTeY1j1cSTrH 5+OXDpcn5d1x0FWY4tZw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gsVma-0007oO-Hx; Sat, 09 Feb 2019 16:47:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gsVmY-0007o2-54 for linux-arm-kernel@lists.infradead.org; Sat, 09 Feb 2019 16:47:11 +0000 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 7F35D218D2; Sat, 9 Feb 2019 16:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549730828; bh=iubSI39owbR/5OxgRxZL+pMKjJpk2EgAx+sbCmO8haI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=B9FUTGyPg6O451fRsNeG4ZwKX9Hnrpvj0eh+G8aQ4YUu4jmD86Uq4bkjnilur/d1Y OuI2+ne2rFbXt0fdfWyYoT/QEdtMa63xGzRSkaCeq5mQKbRffeUD3p3wZvgytnhQjn S6rx6jRxmjauifsP05eBGjEZAkz6CUJW7xHlDH04= Date: Sat, 9 Feb 2019 16:47:02 +0000 From: Jonathan Cameron To: Krzysztof Kozlowski Subject: Re: [PATCH] iio: adc: exynos-adc: Fix NULL pointer exception on unbind Message-ID: <20190209164702.697de406@archlinux> In-Reply-To: <20190208233927.5392-1-krzk@kernel.org> References: <20190208233927.5392-1-krzk@kernel.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190209_084710_211776_10651F60 X-CRM114-Status: GOOD ( 18.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lars-Peter Clausen , linux-iio@vger.kernel.org, Jonathan Bakker , linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Kukjin Kim , Peter Meerwald-Stadler , Hartmut Knaack , linux-arm-kernel@lists.infradead.org, =?UTF-8?B?UGF3ZcWC?= Chmiel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, 9 Feb 2019 00:39:27 +0100 Krzysztof Kozlowski wrote: > 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 Given we have had this one for a little while and are late in the cycle I'm going to queue it up for the coming merge window. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > 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); > } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel