bus: mhi: ep: Only send -ENOTCONN status if client driver is available
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Wed, 28 Dec 2022 16:17:01 +0000 (21:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:31 +0000 (09:34 +0100)
commit353aea15d6edbd4e69e039356a1bd3e641f7d952
tree4285e06edcb43e18e5d75401d3aac61e274668d6
parent189f856e76f5463f59efb5fc18dcc1692d04c41a
bus: mhi: ep: Only send -ENOTCONN status if client driver is available

commit e6cebcc27519dcf1652e604c73b9fd4f416987c0 upstream.

For the STOP and RESET commands, only send the channel disconnect status
-ENOTCONN if client driver is available. Otherwise, it will result in
null pointer dereference.

Cc: <stable@vger.kernel.org> # 5.19
Fixes: e827569062a8 ("bus: mhi: ep: Add support for processing command rings")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://lore.kernel.org/r/20221228161704.255268-4-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bus/mhi/ep/main.c