]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
i2c: mt65xx: fix NULL ptr dereference
authorFabien Parent <fparent@baylibre.com>
Fri, 18 Oct 2019 17:32:13 +0000 (19:32 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Nov 2019 17:47:34 +0000 (18:47 +0100)
commit32d2e60b094833d59e84decaf35e66b82f749011
treed1001d95136892a573166d1ba3699e7476f97dc2
parent14f885aa249b30d4a5075ff891c5b1dd32d1b76e
i2c: mt65xx: fix NULL ptr dereference

BugLink: https://bugs.launchpad.net/bugs/1852111
[ Upstream commit 62931ac2f9015ea38d80494ec37658ab3df6a6d7 ]

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 <fparent@baylibre.com>
Reviewed-by: Cengiz Can <cengiz@kernel.wtf>
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
Tested-by: Ulrich Hecht <uli@fpond.eu>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/i2c/busses/i2c-mt65xx.c