Bug 231567

Summary: [patch] led.c, set_led() always succeed even when it fails
Product: Base System Reporter: Bertrand Petit <bsdpr>
Component: kernAssignee: Oleksandr Tymoshenko <gonzo>
Status: Closed FIXED    
Severity: Affects Only Me CC: bsdpr, gonzo
Priority: --- Keywords: patch
Version: 11.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Return the proper error status to the caller none

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