Skip to content

Commit 9c39011

Browse files
authored
Merge pull request #280 from NOVBobLee/fix_err_handle
Fix missing function call in error handling path
2 parents e3e2ee3 + 620bb0f commit 9c39011

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/hello-sysfs.c

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static int __init mymodule_init(void)
4242

4343
error = sysfs_create_file(mymodule, &myvariable_attribute.attr);
4444
if (error) {
45+
kobject_put(mymodule);
4546
pr_info("failed to create the myvariable file "
4647
"in /sys/kernel/mymodule\n");
4748
}

0 commit comments

Comments
 (0)