lkmpg icon indicating copy to clipboard operation
lkmpg copied to clipboard

vinput: Fix multiple issue

Open visitorckw opened this issue 9 months ago • 3 comments

Fix multiple issues for vinput module:

  1. Removes redundant memset calls that were unnecessary since memory allocated with kzalloc is already zeroed due to the __GFP_ZERO gfp flag.
  2. Fixes a NULL pointer dereference caused by failed kzalloc allocation. It adds a check for the return value of kzalloc and handles failed allocations by printing an error message and returning ERR_PTR(-ENOMEM).
  3. Corrects the handling of failures in raw_copy_to_user() in vinput_read(). Previously, the function would modify '*offset' incorrectly on raw_copy_to_user() failure. Fix this behavior by changing count = -EFAULT to return -EFAULT instead.

visitorckw avatar May 08 '24 17:05 visitorckw

Can you check #52 ?

jserv avatar May 09 '24 04:05 jserv

Looks good to me.

linD026 avatar May 09 '24 04:05 linD026

Can you check #52 ?

I can spend some time understanding try_module_get and put_module_get and try to resolve this issue.

visitorckw avatar May 09 '24 08:05 visitorckw

Thank @visitorckw for contributing!

jserv avatar May 14 '24 21:05 jserv