Linux ioctl cleanup