The following reply was made to PR kern/154287; it has been noted by GNATS.

From: [email protected] (dfilter service)
To: [email protected]
Cc:  
Subject: Re: kern/154287: commit references a PR
Date: Sun, 29 Jan 2012 00:40:59 +0000 (UTC)

 Author: marius
 Date: Sun Jan 29 00:40:39 2012
 New Revision: 230695
 URL: http://svn.freebsd.org/changeset/base/230695
 
 Log:
   MFC: r226175
   
   In device_get_children() avoid malloc(0) in order to increase portability
   to other operating systems.
   
   PR:  154287
 
 Modified:
   stable/9/sys/kern/subr_bus.c
 Directory Properties:
   stable/9/sys/   (props changed)
   stable/9/sys/amd64/include/xen/   (props changed)
   stable/9/sys/boot/   (props changed)
   stable/9/sys/boot/i386/efi/   (props changed)
   stable/9/sys/boot/ia64/efi/   (props changed)
   stable/9/sys/boot/ia64/ski/   (props changed)
   stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
   stable/9/sys/boot/powerpc/ofw/   (props changed)
   stable/9/sys/cddl/contrib/opensolaris/   (props changed)
   stable/9/sys/conf/   (props changed)
   stable/9/sys/contrib/dev/acpica/   (props changed)
   stable/9/sys/contrib/octeon-sdk/   (props changed)
   stable/9/sys/contrib/pf/   (props changed)
   stable/9/sys/contrib/x86emu/   (props changed)
 
 Modified: stable/9/sys/kern/subr_bus.c
 ==============================================================================
 --- stable/9/sys/kern/subr_bus.c       Sun Jan 29 00:35:22 2012        
(r230694)
 +++ stable/9/sys/kern/subr_bus.c       Sun Jan 29 00:40:39 2012        
(r230695)
 @@ -2173,6 +2173,11 @@ device_get_children(device_t dev, device
        TAILQ_FOREACH(child, &dev->children, link) {
                count++;
        }
 +      if (count == 0) {
 +              *devlistp = NULL;
 +              *devcountp = 0;
 +              return (0);
 +      }
  
        list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO);
        if (!list)
 _______________________________________________
 [email protected] mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "[email protected]"
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to