Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit f60a843

Browse files
committed
fix compile on 6.12 and above for kvrealloc
1 parent 7886d81 commit f60a843

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/m3_core.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void * m3_Realloc_Impl (void * i_ptr, size_t i_newSize, size_t i_oldSize)
125125
#else
126126

127127
#include <linux/kernel.h>
128+
#include <linux/version.h>
128129

129130
void * m3_Malloc_Impl (size_t i_size)
130131
{
@@ -140,7 +141,11 @@ void * m3_Realloc_Impl (void * i_ptr, size_t i_newSize, size_t i_oldSize)
140141
{
141142
if (M3_UNLIKELY(i_newSize == i_oldSize)) return i_ptr;
142143

143-
void * newPtr = kvrealloc (i_ptr, i_oldSize, i_newSize, GFP_KERNEL);
144+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
145+
void *newPtr = kvrealloc(i_ptr, i_oldSize, i_newSize, GFP_KERNEL);
146+
#else
147+
void *newPtr = kvrealloc(i_ptr, i_oldSize, GFP_KERNEL);
148+
#endif
144149

145150
if (M3_LIKELY(newPtr))
146151
{

0 commit comments

Comments
 (0)