This is a note to let you know that I've just added the patch titled ion: Make user_ion_handle_put_nolock() a void function to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ion-make-user_ion_handle_put_nolock-a-void-function.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 6747c5b8d01e233fdb983db335c9eb36c9b04b8b Author: Nathan Chancellor <nathan@xxxxxxxxxx> Date: Wed Jul 27 09:46:17 2022 -0700 ion: Make user_ion_handle_put_nolock() a void function Clang warns: drivers/staging/android/ion/ion-ioctl.c:71:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (--handle->user_ref_count == 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/android/ion/ion-ioctl.c:74:9: note: uninitialized use occurs here return ret; ^~~ drivers/staging/android/ion/ion-ioctl.c:71:2: note: remove the 'if' if its condition is always true if (--handle->user_ref_count == 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/android/ion/ion-ioctl.c:69:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 1 warning generated. The return value of user_ion_handle_put_nolock() is not checked in its one call site in user_ion_free_nolock() so just make user_ion_handle_put_nolock() return void to remove the warning. Fixes: a8200613c8c9 ("ion: Protect kref from userspace manipulation") Reported-by: kernel test robot <lkp@xxxxxxxxx> Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> diff --git a/drivers/staging/android/ion/ion-ioctl.c b/drivers/staging/android/ion/ion-ioctl.c index a27865b94416..e020a23d05f2 100644 --- a/drivers/staging/android/ion/ion-ioctl.c +++ b/drivers/staging/android/ion/ion-ioctl.c @@ -64,14 +64,10 @@ static struct ion_handle *pass_to_user(struct ion_handle *handle) } /* Must hold the client lock */ -static int user_ion_handle_put_nolock(struct ion_handle *handle) +static void user_ion_handle_put_nolock(struct ion_handle *handle) { - int ret; - if (--handle->user_ref_count == 0) - ret = ion_handle_put_nolock(handle); - - return ret; + ion_handle_put_nolock(handle); } static void user_ion_free_nolock(struct ion_client *client,