]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: add extra check to safe DMA buffer helper
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 12 Mar 2019 12:44:42 +0000 (13:44 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 13 Mar 2019 17:03:26 +0000 (18:03 +0100)
commitb5ef930ebf315e7c0aa6f64d0aeca0c243edb40a
treed281179a1dfafd96a655cd4234e1238179973113
parentbdbef6e30f507c4629211b91dacd3e879a7b99ed
i2c: add extra check to safe DMA buffer helper

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: dc008008861e ("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>
drivers/i2c/i2c-core-base.c