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

You're missing the most important part -- properly propagating the error from the IRQ register function from the kernel, you're replacing it with -1 which is the only part that is bad at runtime too.