Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5b60ed40 authored by Wentao Liang's avatar Wentao Liang Committed by Greg Kroah-Hartman
Browse files

pcmcia: Add error handling for add_interval() in do_validate_mem()



[ Upstream commit 4a81f78caa53e0633cf311ca1526377d9bff7479 ]

In the do_validate_mem(), the call to add_interval() does not
handle errors. If kmalloc() fails in add_interval(), it could
result in a null pointer being inserted into the linked list,
leading to illegal memory access when sub_interval() is called
next.

This patch adds an error handling for the add_interval(). If
add_interval() returns an error, the function will return early
with the error code.

Fixes: 7b4884ca ("pcmcia: validate late-added resources")
Signed-off-by: default avatarWentao Liang <vulab@iscas.ac.cn>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2baa6c01
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment