Skip to content
Advertisement

Why my IOCTL call work with copy_from_user but not with get_user?

I am writing a simple driver.

Here I’m learning ioctl calls, they work perfect in copy_to_user and copy_from_user part but not in get_user and put_user part. It works if I send some data by those functions; problem is when I have to just pass an integer or character value:

JavaScript

in above part it works fine for the copy to user copy from user but not in case of get_user put_user now the user side code is:

JavaScript

Advertisement

Answer

You must pass addresses, not values. Example:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement