Can't compile "iwlwifi" module in Linux
I’m trying to build iwlwifi
module manually and for my needs.
git.kernel.org/pub/scm/linux/kernel/…/wireless/
When I run Makefile as make
, I get:
<span style="color:#323232;">subcmd-util.h: In function ‘xrealloc’:
</span><span style="color:#323232;">subcmd-util.h:58:31: error: pointer ‘ptr’ may be used after ‘realloc’ [-Werror=use-after-free]
</span><span style="color:#323232;"> 58 | ret = realloc(ptr, 1);
</span><span style="color:#323232;"> | ^~~~~~~~~~~~~~~
</span><span style="color:#323232;">subcmd-util.h:52:21: note: call to ‘realloc’ here
</span><span style="color:#323232;"> 52 | void *ret = realloc(ptr, size);
</span><span style="color:#323232;"> | ^~~~~~~~~~~~~~~~~~
</span><span style="color:#323232;">subcmd-util.h:56:23: error: pointer ‘ptr’ may be used after ‘realloc’ [-Werror=use-after-free]
</span><span style="color:#323232;"> 56 | ret = realloc(ptr, size);
</span><span style="color:#323232;"> | ^~~~~~~~~~~~~~~~~~
</span><span style="color:#323232;">subcmd-util.h:52:21: note: call to ‘realloc’ here
</span><span style="color:#323232;"> 52 | void *ret = realloc(ptr, size);
</span><span style="color:#323232;"> | ^~~~~~~~~~~~~~~~~~
</span><span style="color:#323232;">cc1: all warnings being treated as errors
</span><span style="color:#323232;">make[4]: *** [/data/iwlwifi-fixes/tools/build/Makefile.build:97: /data/iwlwifi-fixes/tools/objtool/help.o] Error 1
</span><span style="color:#323232;">make[3]: *** [Makefile:59: /data/iwlwifi-fixes/tools/objtool/libsubcmd-in.o] Error 2
</span><span style="color:#323232;">make[2]: *** [Makefile:63: /data/iwlwifi-fixes/tools/objtool/libsubcmd.a] Error 2
</span><span style="color:#323232;">make[1]: *** [Makefile:69: objtool] Error 2
</span><span style="color:#323232;">make: *** [Makefile:1349: tools/objtool] Error 2
</span><span style="color:#323232;">
</span>
Why is it? How to fix it?
Add comment