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

Commit bf768a4

Browse files
authored
Merge pull request #121 from uudiin/fix
Fix
2 parents 602374c + 92cdb8d commit bf768a4

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

sgx_main.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ u32 sgx_misc_reserved;
106106
u32 sgx_xsave_size_tbl[64];
107107
bool sgx_has_sgx2;
108108

109-
#ifdef CONFIG_COMPAT
110-
long sgx_compat_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
111-
{
112-
return sgx_ioctl(filep, cmd, arg);
113-
}
114-
#endif
115-
116109
static int sgx_mmap(struct file *file, struct vm_area_struct *vma)
117110
{
118111
vma->vm_ops = &sgx_vm_ops;
@@ -162,7 +155,7 @@ static const struct file_operations sgx_fops = {
162155
.owner = THIS_MODULE,
163156
.unlocked_ioctl = sgx_ioctl,
164157
#ifdef CONFIG_COMPAT
165-
.compat_ioctl = sgx_compat_ioctl,
158+
.compat_ioctl = sgx_ioctl,
166159
#endif
167160
.mmap = sgx_mmap,
168161
.get_unmapped_area = sgx_get_unmapped_area,
@@ -268,7 +261,7 @@ static int sgx_dev_init(struct device *parent)
268261
if (!sgx_add_page_wq) {
269262
pr_err("intel_sgx: alloc_workqueue() failed\n");
270263
ret = -ENOMEM;
271-
goto out_iounmap;
264+
goto out_page_cache;
272265
}
273266

274267
sgx_dev.parent = parent;
@@ -278,12 +271,11 @@ static int sgx_dev_init(struct device *parent)
278271
goto out_workqueue;
279272
}
280273

281-
if (ret)
282-
goto out_workqueue;
283-
284274
return 0;
285275
out_workqueue:
286276
destroy_workqueue(sgx_add_page_wq);
277+
out_page_cache:
278+
sgx_page_cache_teardown();
287279
out_iounmap:
288280
#ifdef CONFIG_X86_64
289281
for (i = 0; i < sgx_nr_epc_banks; i++)

0 commit comments

Comments
 (0)