mailbox: handle failed named mailbox channel request
authormorten petersen <morten_bp@live.dk>
Mon, 8 Jul 2019 11:41:54 +0000 (11:41 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Aug 2019 07:33:41 +0000 (09:33 +0200)
commit450233afb7ab8f65cbd45427b57e422ecae41f34
treeaead70baa67233f18ab7c5eed425d78a313b26df
parentdd1fc2ce32f0b58b15d5c727d237bd8684310735
mailbox: handle failed named mailbox channel request

[ Upstream commit 25777e5784a7b417967460d4fcf9660d05a0c320 ]

Previously, if mbox_request_channel_byname was used with a name
which did not exist in the "mbox-names" property of a mailbox
client, the mailbox corresponding to the last entry in the
"mbox-names" list would be incorrectly selected.
With this patch, -EINVAL is returned if the named mailbox is
not found.

Signed-off-by: Morten Borup Petersen <morten_bp@live.dk>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mailbox/mailbox.c