Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1308838pxu; Mon, 23 Nov 2020 17:58:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbK4s9Y9maEi27Y4XyBgAhhG2hmJssjsOBBOtpHTQ+sg/E+XGJcpZtN0FONEieJ4gWQDnA X-Received: by 2002:a17:906:2f15:: with SMTP id v21mr2295691eji.415.1606183084363; Mon, 23 Nov 2020 17:58:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606183084; cv=none; d=google.com; s=arc-20160816; b=XjoJSgRqr1CJkhk2NeXFqIXpIEySRT9m16Lmp+7rblDr6IyxyjwImVneZmJHVFloyo ZhfmPW30YrLTut8hSq3sM5EKl4WA8tk4x+ShQaEY22mQBO3nHI+cYQ6o6FOH0vHKO4eb A52q3p0ZRueBjUAtuVIFkT/zxPZ/TIJEjYE3FcAYwO4zFlgGctT87aRVFp3E0mp8+J2u UlwcitEgN4cYE7UdhiAZEpzZqaZLAHWAAAY3WywA9g01SpBRg5KbgHRCM7zPCD34iHqB ql0fT1ThhuTh9K1K/0GUHbIRYTmzKH06o4xE+kBABfjM69/y0Z2fy2KjKfcUcY67SNQT /b/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=d2dAYWML3vJbHmk2NU/DScVWvEsyjrlRsqNgxv7R0LM=; b=r9XX7ZP4WEzUJiYUFZnN3UKnIWIj9dGup41OkEhs6MqVpqZS2Zk98Ouh5oRfVeZbfR Eb7A4hbmbES+zoN585FbLGkNESjb6JXQpAapfXU2B/17V42b7rT1ZwlQW3PndAwbcM6n TqlPrsFqhMYyT1DWGSFUWBHNgM71I6Zprmyqo/K5+ge/K7AH/7d85Zt+csntU6lhGHwd QnsPiwmJoiViYSBeye5vPqbnJ+NGdxdmAqW07LEc8lnNyvVSYuQhvlrOHRG/Ty30anqS 0I+RZOvzeZSC6GW4sm/LrEFnsl9sWXmFEa+qd5nHu7TETJmrIqlrRowQmvXIMGWP8e64 vdkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RQuzIfLU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si7372245ejk.78.2020.11.23.17.57.41; Mon, 23 Nov 2020 17:58:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RQuzIfLU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732286AbgKWMjl (ORCPT + 99 others); Mon, 23 Nov 2020 07:39:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:52246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732163AbgKWMjg (ORCPT ); Mon, 23 Nov 2020 07:39:36 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 B54D920857; Mon, 23 Nov 2020 12:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135176; bh=1b0Aao5rEShUAKqxO8dzn14MSNbOZz2LQvNYSXrlzeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQuzIfLU50N3/WVQD6FZ4mnrwSUtdwkmIbb6+DGhBu/KEpwejdTeo9RFQyE+jgSpM RnRfUdPPSEuHnJhBUClK6KdLXQ9tt5EcPFSL679pUfiFQMki7DfTVnYmvCuNVZuo4o zXuFf+tQSov1fc5l/8RGaISKQvL3FM6na0Yk2UKk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabien Parent , Matthias Brugger , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 132/158] iio: adc: mediatek: fix unset field Date: Mon, 23 Nov 2020 13:22:40 +0100 Message-Id: <20201123121826.295492447@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fabien Parent commit 15207a92e019803d62687455d8aa2ff9eb3dc82c upstream. dev_comp field is used in a couple of places but it is never set. This results in kernel oops when dereferencing a NULL pointer. Set the `dev_comp` field correctly in the probe function. Fixes: 6d97024dce23 ("iio: adc: mediatek: mt6577-auxadc, add mt6765 support") Signed-off-by: Fabien Parent Reviewed-by: Matthias Brugger Cc: Link: https://lore.kernel.org/r/20201018194644.3366846-1-fparent@baylibre.com Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/mt6577_auxadc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/iio/adc/mt6577_auxadc.c +++ b/drivers/iio/adc/mt6577_auxadc.c @@ -9,9 +9,9 @@ #include #include #include -#include -#include +#include #include +#include #include #include #include @@ -279,6 +279,8 @@ static int mt6577_auxadc_probe(struct pl goto err_disable_clk; } + adc_dev->dev_comp = device_get_match_data(&pdev->dev); + mutex_init(&adc_dev->lock); mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,