Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/hdaudio Don't attempt to reference a non-existen...



details:   https://anonhg.NetBSD.org/src/rev/33cb6d513ac1
branches:  trunk
changeset: 770962:33cb6d513ac1
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri Nov 04 15:32:34 2011 +0000

description:
Don't attempt to reference a non-existent device.

diffstat:

 sys/dev/pci/hdaudio/hdaudio.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 4b631be7edfe -r 33cb6d513ac1 sys/dev/pci/hdaudio/hdaudio.c
--- a/sys/dev/pci/hdaudio/hdaudio.c     Fri Nov 04 11:54:46 2011 +0000
+++ b/sys/dev/pci/hdaudio/hdaudio.c     Fri Nov 04 15:32:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.15 2011/09/06 10:48:28 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.16 2011/11/04 15:32:34 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.15 2011/09/06 10:48:28 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.16 2011/11/04 15:32:34 jakllsch Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1477,6 +1477,8 @@
        fg = hdaudioioctl_fgrp_lookup(sc, codecid, nid);
        if (fg == NULL)
                return ENODEV;
+       if (fg->fg_device == NULL)
+               return ENXIO;
        fgrp_sc = device_private(fg->fg_device);
        fgrp_dict = device_properties(fg->fg_device);
 



Home | Main Index | Thread Index | Old Index