mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
video: rockchip: mpp: fix potential spectre issue by using array_index_nospec
Change-Id: I40018bac0f5406bc983fbd069c0dbf061f423669 Signed-off-by: Grey Li <grey.li@rock-chips.com>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/nospec.h>
|
||||
|
||||
#include <soc/rockchip/pm_domains.h>
|
||||
|
||||
@@ -776,6 +777,7 @@ static int mpp_process_request(struct mpp_session *session,
|
||||
MPP_DEVICE_BUTT);
|
||||
return -EINVAL;
|
||||
}
|
||||
client_type = array_index_nospec(client_type, MPP_DEVICE_BUTT);
|
||||
mpp = srv->sub_devices[client_type];
|
||||
if (!mpp)
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user