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 <ztong0...@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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to