Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp802141rwi; Mon, 31 Oct 2022 07:44:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7u3oNrF/dsMovLQzahwYfE4mLmCcceReouXOizFe84R2+siUV0T3LRowu/joeKe4Vm/Y1t X-Received: by 2002:aa7:cc8a:0:b0:45b:f851:2943 with SMTP id p10-20020aa7cc8a000000b0045bf8512943mr14440319edt.103.1667227495947; Mon, 31 Oct 2022 07:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667227495; cv=none; d=google.com; s=arc-20160816; b=d/6iuI4HOxcg3hfAA0Z3ytv5GzdwScRQN1z+uM0RBmQEC+5QQjZKEab5S+uwGyRPif JQ7+RK9PhX4EK39IhW2tM0QLSQ/HZq+l1mThzroa4MULuX8v7m8991d1WOcQ75rgix1O uhgf+w7oJhPmQ7GQ4+Lv0o8o3/6/BIcMlPZJ0M1OztvsKkLh7DIt93fDD3pYo3UoSDLV xVHZ5QQcr9Y0FD27zMBxX+q0yGTEcIukcURMjA/y4mIdJYAFbEUlXYLq2yd6ZxQeRCyS GOMbshg3K9vDE/c2ez1AQndAltG+lkVWA3HtqRCsc7jljMR4wu1fMZ5A+ryAfl6EwED3 05oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tLiZKuvP0SUtt1RsXSrtxdXyeMaEyq942pKps2yyHEI=; b=05H7TXr072WXtgFALUcfeF1E0Y4sICWjxLA0zuw1ity4pmVZkK5r94jsohhR0dn+QA VwxVdf3SAabC5KvZwdUOeb2+NI3Tr84roq8RhUO535AZqVM5rE4F1bo145MAyKGykGsL tm3hlAOWWzynEeVm0vIBuSaZ+4L8mcY1pzchy2gY2zQcLOWKlA6wq7Nvqjosy1mNEmB5 WAVY30TX8KaE1xWspQWhk/nb1Z6Py5lO5DntjTidhEjJ01rGAEU8gyyBDO70bRpZ8jaa YUTGdowfC5GYZrbc0qxOEjsQwlxvfchGMlRxg+7GH0MP6caQYjEijdGuUO3OXXcv09dK QqbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YVm6mCIo; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv18-20020a17090760d200b007919fc02ce8si8570993ejc.971.2022.10.31.07.44.30; Mon, 31 Oct 2022 07:44:55 -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=@kernel.org header.s=k20201202 header.b=YVm6mCIo; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbiJaNxI (ORCPT + 98 others); Mon, 31 Oct 2022 09:53:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbiJaNxH (ORCPT ); Mon, 31 Oct 2022 09:53:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ED6D1054C; Mon, 31 Oct 2022 06:53:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A418161234; Mon, 31 Oct 2022 13:53:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5920C433C1; Mon, 31 Oct 2022 13:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667224385; bh=L+f9q+7arbkRsu3om4S7s3pvQcwEFSDo9OD2UXdL+YI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YVm6mCIoQSKHGVK0lw6agZNIgY/5U+amyGkJ1TWE6u/kIcOIGCR3AY8qge4B84BYb OhZD4ExqRb3YKG3ocrcwIDZ+5ArzkBt6wWRtbphEg/ceaQ/pIW70lXCc8IDkB/WmjP RDN2FEsOwIE9O57xKg7v+nyUwZOpO46xUVKq/1B/Fs8xccwhp5I2Ot+Kgji5LcdVsa PggXqSl8fCMh/1++kF7nFrBLsfKnxyFKp7n8/wh0Y9kxXp/0RwZOZz4VcMnxv8H+b3 X2fe855JdpR+QWL05TrteDAUfq66l7SnlHjm/Q2Iz7xjxdvMrPufg3+nfZwOQmOnFA ofAhsByK0yccA== Date: Mon, 31 Oct 2022 13:52:59 +0000 From: Lee Jones To: cy_huang Cc: matthias.bgg@gmail.com, gene_chen@richtek.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, ChiYuan Huang , stable@vger.kernel.org Subject: Re: [PATCH v2] mfd: mt6360: add bound check in regmap read/write function Message-ID: References: <1664416817-31590-1-git-send-email-u0084500@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1664416817-31590-1-git-send-email-u0084500@gmail.com> X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Thu, 29 Sep 2022, cy_huang wrote: > From: ChiYuan Huang > > Fix the potential risk for null pointer if bank index is over the maximum. > > Refer to the discussion list for the experiment result on mt6370. > https://lore.kernel.org/all/20220914013345.GA5802@cyhuang-hp-elitebook-840-g3.rt/ > If not to check the bound, there is the same issue on mt6360. > > Fixes: 3b0850440a06c (mfd: mt6360: Merge different sub-devices I2C read/write) > Cc: stable@vger.kernel.org > Signed-off-by: ChiYuan Huang > --- > Since v2: > - Assign i2c bank variable after bank index is already checked. > > --- > drivers/mfd/mt6360-core.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) Applied, thanks. -- Lee Jones [李琼斯]