]> git.baikalelectronics.ru Git - 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)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 24 Oct 2019 18:52:11 +0000 (20:52 +0200)
commit6161ce130bacf8070eb4992243f86bec2a1b98ce
treeb64a85da8d6439c5c388a039a3077d00589d3c87
parentd84c61ee54edacabfc487c23fb037d5457a1bec7
i2c: mt65xx: fix NULL ptr dereference

Since commit 15972820cf3c ("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: 15972820cf3c ("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>
drivers/i2c/busses/i2c-mt65xx.c