Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4947079pxu; Tue, 13 Oct 2020 10:47:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLgCZ0oS/QXBwQ44Em9bOGSWImt6ON8ShMJTooxjbsTQjQv3AVxgvUpYNWlZ8TwAAXrBRI X-Received: by 2002:a50:fa89:: with SMTP id w9mr688077edr.235.1602611231556; Tue, 13 Oct 2020 10:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602611231; cv=none; d=google.com; s=arc-20160816; b=AZM0mekCBjJTJbXujtThHLmUtOPlTJ+u0KChwB3mcEO/WrtOos+cOP7jt2CwQc1FZh 5mVUNJQa9ly8CZVxXn/8nCR2rMrl6Bl3S77jnBp1imskry8aynNFpKMf1LgDOvbebDEG eU3frN3enUDSDBTz796gn6j5Wd9qaT9ia/hqeFAs3VwfttIf+TE93MLS2npYaKhjYe0S cazGF1ARyg+kHd94b0Ud9wVRJMiTFLWJlh5IT36JYp/ke9Mn0k/NXjjklVPSdPmI0SwR kE6iIT0QCVn07CYqyd42uFj/FeTME15enId/eXbbj5Tv1xPZNsI9IFFJVuQ8zLttwYyw 5Y6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=NqpGyIxGkzBe54LbECwQ4ti1dUnwF1pNvzMYS8Ni1qk=; b=k09IJKQayV3eCLVzvXq3Zc1LDdol/B/J3SopimYezs0gUwsdiS8wMFWAjVpF0QX93r QHNVjePhOQrVRAy+yuuI6feDhl5Jw2uLV0fELg3KpRA2rydcrBJyi3tUDG64V+1BOVOn caaM3FRzeE+zGbgKKUMQRIHsceA5EADSKtd+jbqtK9E5cbbprcADoGWDoKwCvy1BNDbw qMB4cm9MUQJTLGcD0uLKOe1CIIeJRAKKyrrnKNxZLISauUBFXbvsUlZt11yw8N9UUho3 T6mWV7MKf39/LxhLYkc0ouvMBsp2ZcBlaX8ctq6EBw6t5XsTv922n+3wOYjJxMpzq+94 lc7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XVf5bQXd; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r7si234694edi.191.2020.10.13.10.46.46; Tue, 13 Oct 2020 10:47:11 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=XVf5bQXd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731096AbgJMPhQ (ORCPT + 99 others); Tue, 13 Oct 2020 11:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730958AbgJMPhP (ORCPT ); Tue, 13 Oct 2020 11:37:15 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1129DC0613D0; Tue, 13 Oct 2020 08:37:15 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id e17so24570676wru.12; Tue, 13 Oct 2020 08:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NqpGyIxGkzBe54LbECwQ4ti1dUnwF1pNvzMYS8Ni1qk=; b=XVf5bQXdPjnn21q9qd8ieph25Fus4NCdbVyi2mOTg7yq1Zny8DykvIgzN+HC1fete7 f9vZj3i2oo5QzSR9cR7TBYe9zVSq5eUSqBVw9N3UhCNqAeMRVEsaDBlE1J9bS/HZSOEA X5luf2yF6oEX+l4w4nlBDb0xq+INIf0oxr9Ujt2AKtK5CxDXedRK3/rjow/B6dg1DJJA UxKmuMAMkkENLUPzht83TDPSTxMHEhPkGjDaipUMLRsiaiS86n0nOL/RdKPryYntQW+0 ns9bVSv3UwLJKM4j46A2GLAOa0db3yF1roJEqon0ENoym1IRmkGqx2Icqc1J3ZSi1gA2 JXcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NqpGyIxGkzBe54LbECwQ4ti1dUnwF1pNvzMYS8Ni1qk=; b=Qd0YH2MrpRJx+a+ytLfI/U5fJ5WaxpbzefATeez5PBceBSXF+n+3kXm/jSoWpWj+cP 9CFKtyTTxwEkow1frl1C8eY0ZJB13qjgzt/DimotLA6u0d3gk7udF/J4fzHLnbBjEdV2 wBVC0o7i01a/p9spDVjexw7rtsdm16hpnYQDiim/GBVkyaUntap7QMFEYz2oICN4sWQE KaDKSGZTSUvzTus6AJ80WfhC2EX+jMJebIAfiNm1ZeM/bnh5eJtoxW5gMF+Q6Nwcadzm Dk5X8wmR48vZn1YzrYmjyzPubifGAxQ9yfF4jDvxhMkxmzSKGO4A0mYZUSYJLHpAOqou Akpw== X-Gm-Message-State: AOAM531IcjoMqhVXSFMqo8EedlRTezNvL/u67GLQBfmY9Kqc06tqUMV3 jw1mEhwy6wp0QOL0pxvFziy2ib7v03f9bA== X-Received: by 2002:adf:ba85:: with SMTP id p5mr316139wrg.64.1602603433846; Tue, 13 Oct 2020 08:37:13 -0700 (PDT) Received: from ziggy.stardust ([213.195.119.110]) by smtp.gmail.com with ESMTPSA id f14sm30459748wrt.53.2020.10.13.08.37.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Oct 2020 08:37:13 -0700 (PDT) Subject: Re: [PATCH] iio: adc: mediatek: fix unset field To: Fabien Parent , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org Cc: chun-hung.wu@mediatek.com, alexandru.ardelean@analog.com, pmeerw@pmeerw.net, lars@metafoo.de, knaack.h@gmx.de, jic23@kernel.org References: <20201012194618.2170970-1-fparent@baylibre.com> From: Matthias Brugger Message-ID: <61fe6278-a628-820c-6bbd-eeac51b1e7c3@gmail.com> Date: Tue, 13 Oct 2020 17:37:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201012194618.2170970-1-fparent@baylibre.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/10/2020 21:46, Fabien Parent wrote: > 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 Ouch. Reviewed-by: Matthias Brugger > --- > drivers/iio/adc/mt6577_auxadc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c > index ac415cb089cd..7bd48377cd79 100644 > --- a/drivers/iio/adc/mt6577_auxadc.c > +++ b/drivers/iio/adc/mt6577_auxadc.c > @@ -276,6 +276,8 @@ static int mt6577_auxadc_probe(struct platform_device *pdev) > goto err_disable_clk; > } > > + adc_dev->dev_comp = of_device_get_match_data(&pdev->dev); > + > mutex_init(&adc_dev->lock); > > mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, >