kernel: fix compile err. close #647

This commit is contained in:
weishu
2023-06-18 12:51:27 +08:00
parent 1703c16948
commit c12ad9d1c7

View File

@@ -44,7 +44,7 @@ static void do_update_uid(struct work_struct *work)
if (IS_ERR(fp)) { if (IS_ERR(fp)) {
pr_err("do_update_uid, open " SYSTEM_PACKAGES_LIST_PATH pr_err("do_update_uid, open " SYSTEM_PACKAGES_LIST_PATH
" failed: %d\n", " failed: %d\n",
ERR_PTR(fp)); PTR_ERR(fp));
return; return;
} }
@@ -56,13 +56,15 @@ static void do_update_uid(struct work_struct *work)
loff_t line_start = 0; loff_t line_start = 0;
char buf[128]; char buf[128];
for (;;) { for (;;) {
ssize_t count = ksu_kernel_read_compat(fp, &chr, sizeof(chr), &pos); ssize_t count =
ksu_kernel_read_compat(fp, &chr, sizeof(chr), &pos);
if (count != sizeof(chr)) if (count != sizeof(chr))
break; break;
if (chr != '\n') if (chr != '\n')
continue; continue;
count = ksu_kernel_read_compat(fp, buf, sizeof(buf), &line_start); count = ksu_kernel_read_compat(fp, buf, sizeof(buf),
&line_start);
struct uid_data *data = struct uid_data *data =
kmalloc(sizeof(struct uid_data), GFP_ATOMIC); kmalloc(sizeof(struct uid_data), GFP_ATOMIC);