Skip to content

Commit

Permalink
Fix compilation error related to Linux kernel version change
Browse files Browse the repository at this point in the history
More detailed explanation here: https://sysprog21.github.io/lkmpg/
  • Loading branch information
TheBankster authored Oct 21, 2024
1 parent 99565de commit ac1cf4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sev-snp-simulator/sevguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/miscdevice.h>
#include <linux/set_memory.h>
#include <linux/fs.h>
#include <linux/version.h>
#include <crypto/aead.h>
#include <linux/scatterlist.h>

Expand Down Expand Up @@ -352,7 +353,11 @@ static int __init sev_guest_init_module(void) {
}
sev_major = MAJOR(dev);

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
sev_class = class_create(THIS_MODULE, DEVICE_NAME);
#else
sev_class = class_create(DEVICE_NAME);
#endif
if (IS_ERR(sev_class)) {
err = PTR_ERR(sev_class);
goto fail;
Expand Down

0 comments on commit ac1cf4e

Please sign in to comment.