public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
* Coverity: current_value_store(): NO_EFFECT
@ 2021-06-08 18:00 coverity-bot
  0 siblings, 0 replies; only message in thread
From: coverity-bot @ 2021-06-08 18:00 UTC (permalink / raw)
  To: Mark Pearson; +Cc: Hans de Goede, Gustavo A. R. Silva, linux-next

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-08 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-08 18:00 Coverity: current_value_store(): NO_EFFECT coverity-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox