Skip to content

Commit bb3455d

Browse files
author
Luca Marturana
committed
Restore pre-kmalloc_array for older kernels
1 parent 7fc1fe5 commit bb3455d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

driver/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,7 +2058,11 @@ int sysdig_init(void)
20582058

20592059
g_ppm_major = MAJOR(dev);
20602060
g_ppm_numdevs = num_cpus;
2061+
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
2062+
g_ppm_devs = kmalloc(g_ppm_numdevs * sizeof(struct ppm_device), GFP_KERNEL);
2063+
#else
20612064
g_ppm_devs = kmalloc_array(g_ppm_numdevs, sizeof(struct ppm_device), GFP_KERNEL);
2065+
#endif
20622066
if (!g_ppm_devs) {
20632067
pr_err("can't allocate devices\n");
20642068
ret = -ENOMEM;

0 commit comments

Comments
 (0)