From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulrich Hecht Subject: Re: [PATCH v2] i2c: i2c-mt65xx: fix NULL ptr dereference Date: Wed, 2 Oct 2019 10:43:55 +0200 (CEST) Message-ID: <1733244772.936156.1570005835848@webmail.strato.com> References: <20190930152846.5062-1-fparent@baylibre.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190930152846.5062-1-fparent@baylibre.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Fabien Parent , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Cc: drinkcat@chromium.org, wsa@the-dreams.de, hsinyi@chromium.org, matthias.bgg@gmail.com, tglx@linutronix.de, qii.wang@mediatek.com List-Id: linux-i2c@vger.kernel.org > On September 30, 2019 at 5:28 PM Fabien Parent wrote: > > > Since commit abf4923e97c3 ("i2c: mediatek: disable zero-length transfers > for mt8183"), there is a NULL pointer dereference for all the SoCs > that don't have any quirk. mtk_i2c_functionality is not checking that > the quirks pointer is not NULL before starting to use it. > > This commit add a call to i2c_check_quirks which will check whether > the quirks pointer is set, and if so will check if the IP has the > NO_ZERO_LEN quirk. > > Fixes: abf4923e97c3 ("i2c: mediatek: disable zero-length transfers for mt8183") > Signed-off-by: Fabien Parent Thank you! Tested successfully on Acer R13 Chromebook (mt8173). Tested-by: Ulrich Hecht CU Uli