We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1966fd commit 09e8e12Copy full SHA for 09e8e12
1 file changed
load_mali_kernel_module.c
@@ -24,6 +24,9 @@
24
#include <stdlib.h>
25
#include <stdio.h>
26
#include <string.h>
27
+#include <sys/types.h>
28
+#include <sys/stat.h>
29
+#include <fcntl.h>
30
31
static void check_kernel_cmdline(void)
32
{
@@ -47,8 +50,16 @@ static void check_kernel_cmdline(void)
47
50
48
51
void load_mali_kernel_module(void)
49
52
53
+ int fd;
54
+
55
check_kernel_cmdline();
56
57
+ fd = open("/dev/mali", O_RDWR);
58
+ if (fd != -1) {
59
+ close(fd);
60
+ return;
61
+ }
62
63
if (system("modprobe mali >/dev/null 2>&1")) {
64
fprintf(stderr, "Failed to 'modprobe mali'.\n");
65
abort();
0 commit comments