]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
i2c: add extra check to safe DMA buffer helper
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Thu, 25 Apr 2019 04:43:35 +0000 (12:43 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 15 May 2019 12:46:29 +0000 (14:46 +0200)
commit3a9503a601b3f6bdb1035c690266360b336db60b
tree9740310f2a60654156f443658e774e845e286928
parentc0d99d452b66d9783a99507a299f9c4abfaf84af
i2c: add extra check to safe DMA buffer helper

BugLink: https://bugs.launchpad.net/bugs/1787775
From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Make sure we report 'no buffer' for 0-length messages. This can only
happen if threshold is set to 0 which is kind of bogus but we should
still handle this situation. Update the docs and add a debug message
to educate callers of this function.

Reported-by: Hsin-Yi Wang <hsinyi@chromium.org>
Fixes: e94bc5d18be0 ("i2c: add helpers to ease DMA handling")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit bf263c35b2ebe7f1674205f6b36487250299b5a7)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Kleber Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/i2c/i2c-core-base.c