]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
serial: max310x: set default value when reading clock ready bit
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Tue, 16 Jan 2024 21:29:58 +0000 (16:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 07:42:27 +0000 (08:42 +0100)
commit6f248ee7aade38af957f4476b9086b0d14c81902
tree9e34007ef3f4ebb40c971bbb9da59287227810fd
parent92a0a5d613762a96f0f97c36f448ff7cdba8b2f3
serial: max310x: set default value when reading clock ready bit

commit 0419373333c2f2024966d36261fd82a453281e80 upstream.

If regmap_read() returns a non-zero value, the 'val' variable can be left
uninitialized.

Clear it before calling regmap_read() to make sure we properly detect
the clock ready bit.

Fixes: 4cf9a888fd3c ("serial: max310x: Check the clock readiness")
Cc: stable@vger.kernel.org
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20240116213001.3691629-2-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/max310x.c