usb: typec: tipd: Remove WARN_ON in tps6598x_block_read
authorSven Peter <sven@svenpeter.dev>
Tue, 14 Sep 2021 14:02:35 +0000 (16:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 09:39:09 +0000 (10:39 +0100)
commiteff8b7628410cb2eb562ca0d5d1f12e27063733e
tree925f97486eae9e788f5822430a1b21d7653d6909
parent679eee466d0f9ffa60a2b0c6ec19be5128927f04
usb: typec: tipd: Remove WARN_ON in tps6598x_block_read

[ Upstream commit b7a0a63f3fed57d413bb857de164ea9c3984bc4e ]

Calling tps6598x_block_read with a higher than allowed len can be
handled by just returning an error. There's no need to crash systems
with panic-on-warn enabled.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Sven Peter <sven@svenpeter.dev>
Link: https://lore.kernel.org/r/20210914140235.65955-3-sven@svenpeter.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/typec/tps6598x.c