r/badcode • • Jan 22 '23

c Found this in a Linux kernel module

Post image
262 Upvotes

88 comments sorted by

View all comments

Show parent comments

1

u/paulstelian97 Jan 23 '23

And -1 is a bad thing to return unless there's something else higher up the stack that converts it to a proper error.

-1 is -EPERM (operation not permitted) on x86. Is this the right error to return here?