public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Mark Pearson <markpearson@lenovo.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org
Subject: Coverity: current_value_store(): NO_EFFECT
Date: Tue, 8 Jun 2021 11:00:57 -0700	[thread overview]
Message-ID: <202106081100.1A98C8E679@keescook> (raw)

Hello!

This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20210608 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Thu Jun 3 12:56:40 2021 +0200
    a7314b3b1d8a ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")

Coverity reported the following:

*** CID 1505158:    (NO_EFFECT)
/drivers/platform/x86/think-lmi.c: 566 in current_value_store()
560     	}
561
562     	ret = tlmi_simple_call(LENOVO_SET_BIOS_SETTINGS_GUID, set_str);
563     	if (ret)
564     		goto out;
565
vvv     CID 1505158:    (NO_EFFECT)
vvv     Comparing an array to null is not useful: "tlmi_priv.pwd_admin->password", since the test will always evaluate as true.
566     	if (tlmi_priv.pwd_admin->valid && tlmi_priv.pwd_admin->password)
567     		ret = tlmi_save_bios_settings(auth_str);
568     	else
569     		ret = tlmi_save_bios_settings("");
570
571     out:
/drivers/platform/x86/think-lmi.c: 540 in current_value_store()
534     		return -ENOMEM;
535
536     	/* Strip out CR if one is present */
537     	p = strchrnul(new_setting, '\n');
538     	*p = '\0';
539
vvv     CID 1505158:    (NO_EFFECT)
vvv     Comparing an array to null is not useful: "tlmi_priv.pwd_admin->password", since the test will always evaluate as true.
540     	if (tlmi_priv.pwd_admin->valid && tlmi_priv.pwd_admin->password) {
541     		auth_str = kasprintf(GFP_KERNEL, "%s,%s,%s;",
542     				tlmi_priv.pwd_admin->password,
543     				encoding_options[tlmi_priv.pwd_admin->encoding],
544     				tlmi_priv.pwd_admin->kbdlang);
545     		if (!auth_str) {

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1505158 ("NO_EFFECT")
Fixes: a7314b3b1d8a ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")

Thanks for your attention!

-- 
Coverity-bot

                 reply	other threads:[~2021-06-08 18:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202106081100.1A98C8E679@keescook \
    --to=keescook@chromium.org \
    --cc=gustavo@embeddedor.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-next@vger.kernel.org \
    --cc=markpearson@lenovo.com \
    /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