Date: Thu, 27 Aug 2020 16:36:07 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364873 - head/sys/dev/sound/pci Message-ID: <202008271636.07RGa7LT033656@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Thu Aug 27 16:36:07 2020 New Revision: 364873 URL: https://svnweb.freebsd.org/changeset/base/364873 Log: snd_ich(4): Handle errors from ich_init() properly during resume. ich_init() returns an errno value or 0, but ich_pci_resume() was comparing the return value with -1 to determine whether an error had occurred. PR: 248941 Submitted by: Tong Zhang <ztong0001@gmail.com> MFC after: 1 week Modified: head/sys/dev/sound/pci/ich.c Modified: head/sys/dev/sound/pci/ich.c ============================================================================== --- head/sys/dev/sound/pci/ich.c Thu Aug 27 16:34:33 2020 (r364872) +++ head/sys/dev/sound/pci/ich.c Thu Aug 27 16:36:07 2020 (r364873) @@ -1190,16 +1190,17 @@ static int ich_pci_resume(device_t dev) { struct sc_info *sc; - int i; + int err, i; sc = pcm_getdevinfo(dev); ICH_LOCK(sc); /* Reinit audio device */ - if (ich_init(sc) == -1) { + err = ich_init(sc); + if (err != 0) { device_printf(dev, "unable to reinitialize the card\n"); ICH_UNLOCK(sc); - return (ENXIO); + return (err); } /* Reinit mixer */ ich_pci_codec_reset(sc);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008271636.07RGa7LT033656>