Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp288179rwi; Wed, 26 Oct 2022 00:31:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5G93XOl+cXn4YQ72Gs3xBqUY/IIBF37pouk1XD0aAYtM8IhFBhi0J61jr/hXS6iredjT5t X-Received: by 2002:a17:90b:38d1:b0:20d:8f2a:c4c4 with SMTP id nn17-20020a17090b38d100b0020d8f2ac4c4mr2736528pjb.192.1666769464020; Wed, 26 Oct 2022 00:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666769464; cv=none; d=google.com; s=arc-20160816; b=0Ba1loe1B3naXWC1NtWjmHpeWr3q1J4Xh5U+6G+/8wWcPLiMAvPdgX5K57woRXmnBr zqHWjsug4ULd8D8o2PxMbBJdgDZ2UyYrmgFegfY2YzBs5jOoeKrm8XNCB3S3R2YfLAVF U2t/ZGQum0f+rgf/cRXadyJa9WKg9OP25hBxspr3/FdfPSNJKwbHNjEIgqTeDrgg5O7j Jp76wpVdoAjnRajqRLv7/aP1ALhMD/fD/gYpbYT71QanWmjeXkZ0ygIz6Qp03HczpOC6 Y8vAhmlnJ4vX+CgEWlTuhRmNxwj17UvsR3PWvP537miJDQ1IMCxT/ocDsjszC8h95zLZ y+JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=zQUyYnkfD/QphPAhvZx7MKv0769amG9itPpYbqF4pAg=; b=N4ibhiLgtB+vQ7kqSgwU1KsnWqKePBskdACOSJZbzXbGbTT3prUQESJb5jiBtTunDA vFcjD3pHgX5/z6cOurMzRl39mPB+LGHQ6eB120tgeg0+HL2lWPIsvCJa4ZjgAYEq3b6P LRSN8O54aWLHZuT9tICT3X/6CTfruaHk3DgFq584fKp0w/VlACipjCtE46YfkoCTrCAA tJK9XYrfnKqgAXsqas3ef5pButPlUD8eNsYg9wPOrO7iC4yoWxFCGff8jmok8mbSOr/K NCEk/0gDAYGqwL8/f7ec+juhNbyZck5AgUvuTu18NNQJ64e0N25p8QJAVKWJ/Tv+dCeZ OSIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qWl7iB7L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a656783000000b00439e40a8664si2339352pgr.374.2022.10.26.00.30.52; Wed, 26 Oct 2022 00:31:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qWl7iB7L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233174AbiJZHFW (ORCPT + 99 others); Wed, 26 Oct 2022 03:05:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233239AbiJZHFP (ORCPT ); Wed, 26 Oct 2022 03:05:15 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E6865BCAE for ; Wed, 26 Oct 2022 00:05:11 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id n14so5326642wmq.3 for ; Wed, 26 Oct 2022 00:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zQUyYnkfD/QphPAhvZx7MKv0769amG9itPpYbqF4pAg=; b=qWl7iB7LmbYBsmiX/9/8KvoCoJKf1FBBDgoMyja/yFA/2kloeRbdOx+lTsehp+1xE/ JjW4RdhwYefgJ30e7ZNhJYflZDRgkBtMFEqItkbKfvWOPSkCnaZhS0ZjJ6glzS/to6M6 3TfsfLPB53AJrNDOm2gBL04x1qu2IHJJT/AIVP4pGx7Y3xULtbwHFE3B3d1pwgdtDsS3 ILAB8k2YLQoILmJPqrDeNZNk0O1op4H1u7NsZ7QZy0tIGk5tnxLJWAL+m551aLxu1PWc /Ky4ak4ThxXs5SyOGK57yu94EgeYfIpbsQ3JeVzG57ZLorCPk2lXUw9BwxisJJPYfCLS XzGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zQUyYnkfD/QphPAhvZx7MKv0769amG9itPpYbqF4pAg=; b=1c0um7AKXTOdCQj6d2y+PjO2WABu7QRbG3BZqhGVwNXrHNEgpjdT6trGXiyc60Yj9r z0aR8mqBWebp3mHRGW/4fludMO8R8YavwHLewLcFt5Ugj8HqqV2oFd0xF6ft59SP/mU1 LVKSuvHFTfoHzzz99I3T8X24Ye09e8cUmZKDQfepmR4LWR8fG9TaGFxkKVoZ1lWav9oW dBH/KXFTyMh4zUFyg6l8pOUXMtPSj0CpYeVnTeYGTkDfjuhWdygvPV+Bp6J32k0tWHGw CjncWVM/gqUFaqsWPcCr785a2B5oCwuDBbTzNrLj6v3SzI0+7UT/VGODJLIZvPdI2mGr RgmQ== X-Gm-Message-State: ACrzQf1zIl+mIrbmkg7DcNhF6DYD2/IJPeIZ34r9TdCSQDqnERh6OAIO mjIWpMU2NFt7J8R53Dsev8jF91No8vsd6EYDmJf0M22xB+MEHg== X-Received: by 2002:a05:600c:1990:b0:3c9:a5e8:addb with SMTP id t16-20020a05600c199000b003c9a5e8addbmr1273615wmq.140.1666767909354; Wed, 26 Oct 2022 00:05:09 -0700 (PDT) MIME-Version: 1.0 References: <1666318661-11777-1-git-send-email-u0084500@gmail.com> In-Reply-To: From: ChiYuan Huang Date: Wed, 26 Oct 2022 15:04:57 +0800 Message-ID: Subject: Re: [PATCH v2] mfd: mt6370: Add the out-of-bound check to prevent the null pointer To: Andy Shevchenko Cc: lee@kernel.org, matthias.bgg@gmail.com, chiaen_wu@richtek.com, cy_huang@richtek.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Shevchenko =E6=96=BC 2022=E5=B9=B410=E6=9C= =8821=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=886:35=E5=AF=AB=E9=81=93= =EF=BC=9A > > On Fri, Oct 21, 2022 at 12:58 PM ChiYuan Huang wrote= : > > Andy Shevchenko =E6=96=BC 2022=E5=B9=B410= =E6=9C=8821=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=885:14=E5=AF=AB=E9= =81=93=EF=BC=9A > > > On Fri, Oct 21, 2022 at 12:02 PM ChiYuan Huang w= rote: > > > > Andy Shevchenko =E6=96=BC 2022=E5=B9=B4= 10=E6=9C=8821=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=884:34=E5=AF=AB= =E9=81=93=EF=BC=9A > > > > > On Fri, Oct 21, 2022 at 5:17 AM cy_huang wro= te: > > ... > > > > > > https://www.kernel.org/doc/html/latest/process/submitting-patches= .html#backtraces-in-commit-messages > > > > > > Have you had a chance to read this section of the document? > > > > > OK, get it. > > Is the below text enough to express this problem? > > It is you who decides, because I don't know what exact problem this > will represent. > > > Ex. Testing as below (mt6370 register range from 0 to 0x1ff) > > rg_bound_show() > > regmap_raw_read(regmap, 0x200, &val, sizeof(val)); > > > pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=3D--) > > For example, why is this line here? > > > pc : i2c_smbus_xfer+0x58/0x120 > > lr : i2c_smbus_read_i2c_block_data+0x74/0xc0 > > Call trace: > > i2c_smbus_xfer+0x58/0x120 > > i2c_smbus_read_i2c_block_data+0x74/0xc0 > > mt6370_regmap_read+0x40/0x60 > > _regmap_raw_read+0xe4/0x278 > > regmap_raw_read+0xec/0x240 > > rg_bound_show+0xb0/0x120 > > The rule of thumb is that it's okay to shrink to ~4-5 lines (in most case= s). > At first, I start this thread due to the original thread seems stopped Since it already restarted, please forget this one. Just follow the restaed thread for the discussion. https://lore.kernel.org/all/Y1aCiReTZDbPp%2FrS@kadam/ > -- > With Best Regards, > Andy Shevchenko