Bug 231567 - [patch] led.c, set_led() always succeed even when it fails
Summary: [patch] led.c, set_led() always succeed even when it fails
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.2-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Oleksandr Tymoshenko
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2018-09-21 23:20 UTC by Bertrand Petit
Modified: 2019-02-03 14:56 UTC (History)
2 users (show)

See Also:


Attachments
Return the proper error status to the caller (305 bytes, patch)
2018-09-21 23:20 UTC, Bertrand Petit
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Petit 2018-09-21 23:20:33 UTC
Created attachment 197324 [details]
Return the proper error status to the caller

The return value of set_led() in sys/dev/led/ is always zero even a failure ocurr. The attached patch return the error code to the caller when an error occurs.
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-01-15 00:53:00 UTC
A commit references this bug:

Author: gonzo
Date: Tue Jan 15 00:52:41 UTC 2019
New revision: 343029
URL: https://svnweb.freebsd.org/changeset/base/343029

Log:
  [led] propagate error from set_led() to the caller

  Do not lose error condition by always returning 0 from set_led.
  None of the calls to set_led checks for return value at the moment so
  none of API consumers in base is affected.

  PR:		231567
  Submitted by:	Bertrand Petit <bsdpr@phoe.frmug.org>
  MFC after:	1 week

Changes:
  head/sys/dev/led/led.c
Comment 2 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-15 00:56:58 UTC
Thanks for submitting the patch, I committed it to HEAD and will handle MFC
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-02-03 14:56:16 UTC
A commit references this bug:

Author: gonzo
Date: Sun Feb  3 14:55:22 UTC 2019
New revision: 343716
URL: https://svnweb.freebsd.org/changeset/base/343716

Log:
  MFC r343029:

  [led] propagate error from set_led() to the caller

  Do not lose error condition by always returning 0 from set_led.
  None of the calls to set_led checks for return value at the moment so
  none of API consumers in base is affected.

  PR:		231567
  Submitted by:	Bertrand Petit <bsdpr@phoe.frmug.org>

Changes:
_U  stable/12/
  stable/12/sys/dev/led/led.c