]> git.baikalelectronics.ru Git - kernel.git/commit
bus: mhi: core: Ensure non-zero session or sequence ID values are used
authorBhaumik Bhatt <bbhatt@codeaurora.org>
Thu, 21 May 2020 17:02:43 +0000 (22:32 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 May 2020 07:35:43 +0000 (09:35 +0200)
commit0ab9fcd0e7b2b45dd407e145f50fd55091405d3c
tree0d980982c2a46c9a2eb12caa5949f2874f00faaf
parent0a895f091ebd943555efce3d7b0e96d667208fdc
bus: mhi: core: Ensure non-zero session or sequence ID values are used

While writing any sequence or session identifiers, it is possible that
the host could write a zero value, whereas only non-zero values should
be supported writes to those registers. Ensure that the host does not
write a non-zero value for them and also log them in debug messages. A
macro is introduced to simplify this check and the existing checks are
also converted to use this macro.

Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20200521170249.21795-9-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bus/mhi/core/boot.c
drivers/bus/mhi/core/internal.h