From: Greg KH <gregkh@linuxfoundation.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Sasha Levin <sashal@kernel.org>,
Daniel Rosenberg <drosen@google.com>,
stable@vger.kernel.org, llvm@lists.linux.dev,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH 4.9] ion: Make user_ion_handle_put_nolock() a void function
Date: Mon, 1 Aug 2022 10:54:23 +0200 [thread overview]
Message-ID: <YueUv32PkLdw651V@kroah.com> (raw)
In-Reply-To: <20220727164617.980209-1-nathan@kernel.org>
On Wed, Jul 27, 2022 at 09:46:17AM -0700, Nathan Chancellor wrote:
> 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@intel.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/staging/android/ion/ion-ioctl.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2022-08-01 8:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 16:46 [PATCH 4.9] ion: Make user_ion_handle_put_nolock() a void function Nathan Chancellor
2022-08-01 8:54 ` Patch "ion: Make user_ion_handle_put_nolock() a void function" has been added to the 4.9-stable tree gregkh
2022-08-01 8:54 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YueUv32PkLdw651V@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=drosen@google.com \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox