mirror of
https://github.com/openharmony/kernel_linux_common_modules.git
synced 2026-08-26 17:16:37 -04:00
xpm validator code check waring clear
Signed-off-by: yang1946 <yuzhaoyang1@huawei.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
||||
*/
|
||||
#include <linux/string.h>
|
||||
#include <linux/elf.h>
|
||||
@@ -32,7 +32,7 @@ static int read_elf_info(struct file *file, void *buffer, size_t read_size, loff
|
||||
{
|
||||
size_t len;
|
||||
|
||||
len = kernel_read(file, buffer, read_size, &pos);
|
||||
len = (size_t)kernel_read(file, buffer, read_size, &pos);
|
||||
if (unlikely(len != read_size))
|
||||
return -EIO;
|
||||
|
||||
@@ -267,7 +267,7 @@ static int find_elf_code_segment_info(const char *phdr_info, struct elf_info *el
|
||||
if (segment_count == 0)
|
||||
return -ENOEXEC;
|
||||
|
||||
size = sizeof(struct exec_file_signature_info) + segment_count * sizeof(struct exec_segment_info);
|
||||
size = sizeof(struct exec_file_signature_info) + (size_t)segment_count * sizeof(struct exec_segment_info);
|
||||
exec_file_info = kzalloc(size, GFP_KERNEL);
|
||||
if (exec_file_info == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
||||
*/
|
||||
#include <linux/string.h>
|
||||
#include <linux/fcntl.h>
|
||||
@@ -338,7 +338,7 @@ static void rb_erase_node(struct rb_root *root, int *node_count,
|
||||
(*node_count)--;
|
||||
}
|
||||
|
||||
static int find_idle_nodes(struct rb_root *root, uintptr_t *ilde_nodes, size_t count)
|
||||
static int find_idle_nodes(struct rb_root *root, uintptr_t *ilde_nodes, int count)
|
||||
{
|
||||
int i = 0;
|
||||
struct exec_file_signature_info *code_segment;
|
||||
@@ -476,7 +476,7 @@ static int get_verity_info(int type, struct verity_info *verity)
|
||||
static void insert_new_signature_info(struct inode *file_node, int type,
|
||||
struct verity_info *verity, struct exec_file_signature_info *new_info, struct exec_file_signature_info **old_info)
|
||||
{
|
||||
new_info->type = type;
|
||||
new_info->type = (unsigned int)type;
|
||||
new_info->inode = (uintptr_t)file_node;
|
||||
RB_CLEAR_NODE(&new_info->rb_node);
|
||||
if ((*old_info) != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user