mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02: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:
parent
e195cba5b6
commit
2dc8014581
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user