From 04dd17822334871b23ea2862f7798fb0e0007777 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Sat, 11 May 2024 08:53:19 +0000 Subject: [PATCH] change otg to host mode --- kernel/include/linux/thread_info.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/kernel/include/linux/thread_info.h b/kernel/include/linux/thread_info.h index 62dbecf..f3040b0 100644 --- a/kernel/include/linux/thread_info.h +++ b/kernel/include/linux/thread_info.h @@ -147,7 +147,7 @@ WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count); } -static __always_inline bool +static __always_inline __must_check bool check_copy_size(const void *addr, size_t bytes, bool is_source) { int sz = __compiletime_object_size(addr); @@ -160,6 +160,8 @@ __bad_copy_to(); return false; } + if (WARN_ON_ONCE(bytes > INT_MAX)) + return false; check_object_size(addr, bytes, is_source); return true; } -- Gitblit v1.6.2